QGIS API Documentation  3.6.0-Noosa (5873452)
Static Public Member Functions | List of all members
QgsProcessingParameters Class Reference

A collection of utilities for working with parameters when running a processing algorithm. More...

#include <qgsprocessingparameters.h>

Static Public Member Functions

static QString descriptionFromName (const QString &name)
 Creates an autogenerated parameter description from a parameter name. More...
 
static bool isDynamic (const QVariantMap &parameters, const QString &name)
 Returns true if the parameter with matching name is a dynamic parameter, and must be evaluated once for every input feature processed. More...
 
static bool parameterAsBool (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a static boolean value. More...
 
static bool parameterAsBool (const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a static boolean value. More...
 
static QString parameterAsCompatibleSourceLayerPath (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, const QStringList &compatibleFormats, const QString &preferredFormat=QString("shp"), QgsProcessingFeedback *feedback=nullptr)
 Evaluates the parameter with matching definition to a source vector layer file path of compatible format. More...
 
static QgsCoordinateReferenceSystem parameterAsCrs (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a coordinate reference system. More...
 
static QgsCoordinateReferenceSystem parameterAsCrs (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a coordinate reference system. More...
 
static double parameterAsDouble (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a static double value. More...
 
static double parameterAsDouble (const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a static double value. More...
 
static int parameterAsEnum (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a enum value. More...
 
static int parameterAsEnum (const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a enum value. More...
 
static QList< int > parameterAsEnums (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition to list of enum values. More...
 
static QList< int > parameterAsEnums (const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to list of enum values. More...
 
static QString parameterAsExpression (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition to an expression. More...
 
static QString parameterAsExpression (const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context)
 Evaluates the parameter with matching definitionand value to an expression. More...
 
static QgsRectangle parameterAsExtent (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
 Evaluates the parameter with matching definition to a rectangular extent. More...
 
static QgsRectangle parameterAsExtent (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
 Evaluates the parameter with matching definition and value to a rectangular extent. More...
 
static QgsCoordinateReferenceSystem parameterAsExtentCrs (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Returns the coordinate reference system associated with an extent parameter value. More...
 
static QgsGeometry parameterAsExtentGeometry (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
 Evaluates the parameter with matching definition to a rectangular extent, and returns a geometry covering this extent. More...
 
static QStringList parameterAsFields (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a list of fields. More...
 
static QStringList parameterAsFields (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a list of fields. More...
 
static QString parameterAsFile (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a file/folder name. More...
 
static QString parameterAsFile (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a file/folder name. More...
 
static QString parameterAsFileOutput (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a file based output destination. More...
 
static QString parameterAsFileOutput (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a file based output destination. More...
 
static int parameterAsInt (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a static integer value. More...
 
static int parameterAsInt (const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a static integer value. More...
 
static QList< int > parameterAsInts (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a list of integer values. More...
 
static QList< int > parameterAsInts (const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a list of integer values. More...
 
static QgsMapLayerparameterAsLayer (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a map layer. More...
 
static QgsMapLayerparameterAsLayer (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a map layer. More...
 
static QList< QgsMapLayer * > parameterAsLayerList (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a list of map layers. More...
 
static QList< QgsMapLayer * > parameterAsLayerList (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a list of map layers. More...
 
static QVariantList parameterAsMatrix (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a matrix/table of values. More...
 
static QVariantList parameterAsMatrix (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a matrix/table of values. More...
 
static QgsMeshLayerparameterAsMeshLayer (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a mesh layer. More...
 
static QgsMeshLayerparameterAsMeshLayer (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a mesh layer. More...
 
static QString parameterAsOutputLayer (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a output layer destination. More...
 
static QString parameterAsOutputLayer (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a output layer destination. More...
 
static QgsPointXY parameterAsPoint (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
 Evaluates the parameter with matching definition to a point. More...
 
static QgsPointXY parameterAsPoint (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
 Evaluates the parameter with matching definition and value to a point. More...
 
static QgsCoordinateReferenceSystem parameterAsPointCrs (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Returns the coordinate reference system associated with an point parameter value. More...
 
static QList< double > parameterAsRange (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a range of values. More...
 
static QList< double > parameterAsRange (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a range of values. More...
 
static QgsRasterLayerparameterAsRasterLayer (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a raster layer. More...
 
static QgsRasterLayerparameterAsRasterLayer (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a raster layer. More...
 
static QgsFeatureSinkparameterAsSink (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs, QgsProcessingContext &context, QString &destinationIdentifier, QgsFeatureSink::SinkFlags sinkFlags=nullptr)
 Evaluates the parameter with matching definition to a feature sink. More...
 
static QgsFeatureSinkparameterAsSink (const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs, QgsProcessingContext &context, QString &destinationIdentifier, QgsFeatureSink::SinkFlags sinkFlags=nullptr)
 Evaluates the parameter with matching definition and value to a feature sink. More...
 
static QgsProcessingFeatureSourceparameterAsSource (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a feature source. More...
 
static QgsProcessingFeatureSourceparameterAsSource (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a feature source. More...
 
static QString parameterAsString (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a static string value. More...
 
static QString parameterAsString (const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a static string value. More...
 
static QgsVectorLayerparameterAsVectorLayer (const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
 Evaluates the parameter with matching definition to a vector layer. More...
 
static QgsVectorLayerparameterAsVectorLayer (const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context)
 Evaluates the parameter with matching definition and value to a vector layer. More...
 
static QgsProcessingParameterDefinitionparameterFromScriptCode (const QString &code)
 Creates a new QgsProcessingParameterDefinition using the configuration from a supplied script code string. More...
 
static QgsProcessingParameterDefinitionparameterFromVariantMap (const QVariantMap &map)
 Creates a new QgsProcessingParameterDefinition using the configuration from a supplied variant map. More...
 

Detailed Description

A collection of utilities for working with parameters when running a processing algorithm.

Parameters are stored in a QVariantMap and referenced by a unique string key. The QVariants in parameters are not usually accessed directly, and instead the high level API provided through QgsProcessingParameters parameterAsString(), parameterAsDouble() are used instead.

Parameters are evaluated using a provided QgsProcessingContext, allowing the evaluation to understand available map layers and expression contexts (for expression based parameters).

Since
QGIS 3.0

Definition at line 567 of file qgsprocessingparameters.h.

Member Function Documentation

◆ descriptionFromName()

QString QgsProcessingParameters::descriptionFromName ( const QString &  name)
static

Creates an autogenerated parameter description from a parameter name.

Definition at line 1536 of file qgsprocessingparameters.cpp.

◆ isDynamic()

bool QgsProcessingParameters::isDynamic ( const QVariantMap &  parameters,
const QString &  name 
)
static

Returns true if the parameter with matching name is a dynamic parameter, and must be evaluated once for every input feature processed.

Definition at line 53 of file qgsprocessingparameters.cpp.

◆ parameterAsBool() [1/2]

bool QgsProcessingParameters::parameterAsBool ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a static boolean value.

Definition at line 334 of file qgsprocessingparameters.cpp.

◆ parameterAsBool() [2/2]

bool QgsProcessingParameters::parameterAsBool ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a static boolean value.

Since
QGIS 3.4

Definition at line 342 of file qgsprocessingparameters.cpp.

◆ parameterAsCompatibleSourceLayerPath()

QString QgsProcessingParameters::parameterAsCompatibleSourceLayerPath ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context,
const QStringList &  compatibleFormats,
const QString &  preferredFormat = QString( "shp" ),
QgsProcessingFeedback feedback = nullptr 
)
static

Evaluates the parameter with matching definition to a source vector layer file path of compatible format.

If the parameter is evaluated to an existing layer, and that layer is not of the format listed in the compatibleFormats argument, then the layer will first be exported to a compatible format in a temporary location. The function will then return the path to that temporary file.

compatibleFormats should consist entirely of lowercase file extensions, e.g. 'shp'.

The preferredFormat argument is used to specify to desired file extension to use when a temporary layer export is required. This defaults to shapefiles, because shapefiles are the future (don't believe the geopackage hype!).

Definition at line 451 of file qgsprocessingparameters.cpp.

◆ parameterAsCrs() [1/2]

QgsCoordinateReferenceSystem QgsProcessingParameters::parameterAsCrs ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a coordinate reference system.

Definition at line 719 of file qgsprocessingparameters.cpp.

◆ parameterAsCrs() [2/2]

QgsCoordinateReferenceSystem QgsProcessingParameters::parameterAsCrs ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a coordinate reference system.

Since
QGIS 3.4

Definition at line 727 of file qgsprocessingparameters.cpp.

◆ parameterAsDouble() [1/2]

double QgsProcessingParameters::parameterAsDouble ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a static double value.

Definition at line 122 of file qgsprocessingparameters.cpp.

◆ parameterAsDouble() [2/2]

double QgsProcessingParameters::parameterAsDouble ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a static double value.

Since
QGIS 3.4

Definition at line 130 of file qgsprocessingparameters.cpp.

◆ parameterAsEnum() [1/2]

int QgsProcessingParameters::parameterAsEnum ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a enum value.

Definition at line 248 of file qgsprocessingparameters.cpp.

◆ parameterAsEnum() [2/2]

int QgsProcessingParameters::parameterAsEnum ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a enum value.

Since
QGIS 3.4

Definition at line 256 of file qgsprocessingparameters.cpp.

◆ parameterAsEnums() [1/2]

QList< int > QgsProcessingParameters::parameterAsEnums ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to list of enum values.

Definition at line 270 of file qgsprocessingparameters.cpp.

◆ parameterAsEnums() [2/2]

QList< int > QgsProcessingParameters::parameterAsEnums ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to list of enum values.

Since
QGIS 3.4

Definition at line 278 of file qgsprocessingparameters.cpp.

◆ parameterAsExpression() [1/2]

QString QgsProcessingParameters::parameterAsExpression ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to an expression.

Definition at line 94 of file qgsprocessingparameters.cpp.

◆ parameterAsExpression() [2/2]

QString QgsProcessingParameters::parameterAsExpression ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definitionand value to an expression.

Since
QGIS 3.4

Definition at line 102 of file qgsprocessingparameters.cpp.

◆ parameterAsExtent() [1/2]

QgsRectangle QgsProcessingParameters::parameterAsExtent ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context,
const QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem() 
)
static

Evaluates the parameter with matching definition to a rectangular extent.

If crs is set, and the original coordinate reference system of the parameter can be determined, then the extent will be automatically reprojected so that it is in the specified crs. In this case the extent of the reproject rectangle will be returned.

See also
parameterAsExtentGeometry()
parameterAsExtentCrs()

Definition at line 791 of file qgsprocessingparameters.cpp.

◆ parameterAsExtent() [2/2]

QgsRectangle QgsProcessingParameters::parameterAsExtent ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context,
const QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem() 
)
static

Evaluates the parameter with matching definition and value to a rectangular extent.

If crs is set, and the original coordinate reference system of the parameter can be determined, then the extent will be automatically reprojected so that it is in the specified crs. In this case the extent of the reproject rectangle will be returned.

See also
parameterAsExtentGeometry()
parameterAsExtentCrs()
Since
QGIS 3.4

Definition at line 800 of file qgsprocessingparameters.cpp.

◆ parameterAsExtentCrs()

QgsCoordinateReferenceSystem QgsProcessingParameters::parameterAsExtentCrs ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Returns the coordinate reference system associated with an extent parameter value.

See also
parameterAsExtent()

Definition at line 1033 of file qgsprocessingparameters.cpp.

◆ parameterAsExtentGeometry()

QgsGeometry QgsProcessingParameters::parameterAsExtentGeometry ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context,
const QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem() 
)
static

Evaluates the parameter with matching definition to a rectangular extent, and returns a geometry covering this extent.

If crs is set, and the original coordinate reference system of the parameter can be determined, then the extent will be automatically reprojected so that it is in the specified crs. Unlike parameterAsExtent(), the reprojected rectangle returned by this function will no longer be a rectangle itself (i.e. this method returns the geometry of the actual reprojected rectangle, while parameterAsExtent() returns just the extent of the reprojected rectangle).

See also
parameterAsExtent()
parameterAsExtentCrs()

Definition at line 915 of file qgsprocessingparameters.cpp.

◆ parameterAsFields() [1/2]

QStringList QgsProcessingParameters::parameterAsFields ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a list of fields.

Definition at line 1419 of file qgsprocessingparameters.cpp.

◆ parameterAsFields() [2/2]

QStringList QgsProcessingParameters::parameterAsFields ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a list of fields.

Since
QGIS 3.4

Definition at line 1428 of file qgsprocessingparameters.cpp.

◆ parameterAsFile() [1/2]

QString QgsProcessingParameters::parameterAsFile ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a file/folder name.

Definition at line 1218 of file qgsprocessingparameters.cpp.

◆ parameterAsFile() [2/2]

QString QgsProcessingParameters::parameterAsFile ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a file/folder name.

Since
QGIS 3.4

Definition at line 1229 of file qgsprocessingparameters.cpp.

◆ parameterAsFileOutput() [1/2]

QString QgsProcessingParameters::parameterAsFileOutput ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a file based output destination.

Definition at line 666 of file qgsprocessingparameters.cpp.

◆ parameterAsFileOutput() [2/2]

QString QgsProcessingParameters::parameterAsFileOutput ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a file based output destination.

Since
QGIS 3.4

Definition at line 676 of file qgsprocessingparameters.cpp.

◆ parameterAsInt() [1/2]

int QgsProcessingParameters::parameterAsInt ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a static integer value.

Definition at line 149 of file qgsprocessingparameters.cpp.

◆ parameterAsInt() [2/2]

int QgsProcessingParameters::parameterAsInt ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a static integer value.

Since
QGIS 3.4

Definition at line 157 of file qgsprocessingparameters.cpp.

◆ parameterAsInts() [1/2]

QList< int > QgsProcessingParameters::parameterAsInts ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a list of integer values.

Since
QGIS 3.4

Definition at line 191 of file qgsprocessingparameters.cpp.

◆ parameterAsInts() [2/2]

QList< int > QgsProcessingParameters::parameterAsInts ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a list of integer values.

Since
QGIS 3.4

Definition at line 199 of file qgsprocessingparameters.cpp.

◆ parameterAsLayer() [1/2]

QgsMapLayer * QgsProcessingParameters::parameterAsLayer ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a map layer.

Layers will either be taken from context's active project, or loaded from external sources and stored temporarily in the context. In either case, callers do not need to handle deletion of the returned layer.

Definition at line 520 of file qgsprocessingparameters.cpp.

◆ parameterAsLayer() [2/2]

QgsMapLayer * QgsProcessingParameters::parameterAsLayer ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a map layer.

Layers will either be taken from context's active project, or loaded from external sources and stored temporarily in the context. In either case, callers do not need to handle deletion of the returned layer.

Since
QGIS 3.4

Definition at line 528 of file qgsprocessingparameters.cpp.

◆ parameterAsLayerList() [1/2]

QList< QgsMapLayer * > QgsProcessingParameters::parameterAsLayerList ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a list of map layers.

Definition at line 1278 of file qgsprocessingparameters.cpp.

◆ parameterAsLayerList() [2/2]

QList< QgsMapLayer * > QgsProcessingParameters::parameterAsLayerList ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a list of map layers.

Since
QGIS 3.4

Definition at line 1286 of file qgsprocessingparameters.cpp.

◆ parameterAsMatrix() [1/2]

QVariantList QgsProcessingParameters::parameterAsMatrix ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a matrix/table of values.

Tables are collapsed to a 1 dimensional list.

Definition at line 1240 of file qgsprocessingparameters.cpp.

◆ parameterAsMatrix() [2/2]

QVariantList QgsProcessingParameters::parameterAsMatrix ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a matrix/table of values.

Tables are collapsed to a 1 dimensional list.

Since
QGIS 3.4

Definition at line 1248 of file qgsprocessingparameters.cpp.

◆ parameterAsMeshLayer() [1/2]

QgsMeshLayer * QgsProcessingParameters::parameterAsMeshLayer ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a mesh layer.

Layers will either be taken from context's active project, or loaded from external sources and stored temporarily in the context. In either case, callers do not need to handle deletion of the returned layer.

Since
QGIS 3.6

Definition at line 587 of file qgsprocessingparameters.cpp.

◆ parameterAsMeshLayer() [2/2]

QgsMeshLayer * QgsProcessingParameters::parameterAsMeshLayer ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a mesh layer.

Layers will either be taken from context's active project, or loaded from external sources and stored temporarily in the context. In either case, callers do not need to handle deletion of the returned layer.

Since
QGIS 3.6

Definition at line 592 of file qgsprocessingparameters.cpp.

◆ parameterAsOutputLayer() [1/2]

QString QgsProcessingParameters::parameterAsOutputLayer ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a output layer destination.

Definition at line 597 of file qgsprocessingparameters.cpp.

◆ parameterAsOutputLayer() [2/2]

QString QgsProcessingParameters::parameterAsOutputLayer ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a output layer destination.

Since
QGIS 3.4

Definition at line 607 of file qgsprocessingparameters.cpp.

◆ parameterAsPoint() [1/2]

QgsPointXY QgsProcessingParameters::parameterAsPoint ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context,
const QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem() 
)
static

Evaluates the parameter with matching definition to a point.

If crs is set then the point will be automatically reprojected so that it is in the specified crs.

See also
parameterAsPointCrs()

Definition at line 1110 of file qgsprocessingparameters.cpp.

◆ parameterAsPoint() [2/2]

QgsPointXY QgsProcessingParameters::parameterAsPoint ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context,
const QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem() 
)
static

Evaluates the parameter with matching definition and value to a point.

If crs is set then the point will be automatically reprojected so that it is in the specified crs.

See also
parameterAsPointCrs()
Since
QGIS 3.4

Definition at line 1118 of file qgsprocessingparameters.cpp.

◆ parameterAsPointCrs()

QgsCoordinateReferenceSystem QgsProcessingParameters::parameterAsPointCrs ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Returns the coordinate reference system associated with an point parameter value.

See also
parameterAsPoint()

Definition at line 1188 of file qgsprocessingparameters.cpp.

◆ parameterAsRange() [1/2]

QList< double > QgsProcessingParameters::parameterAsRange ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a range of values.

Definition at line 1370 of file qgsprocessingparameters.cpp.

◆ parameterAsRange() [2/2]

QList< double > QgsProcessingParameters::parameterAsRange ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a range of values.

Since
QGIS 3.4

Definition at line 1378 of file qgsprocessingparameters.cpp.

◆ parameterAsRasterLayer() [1/2]

QgsRasterLayer * QgsProcessingParameters::parameterAsRasterLayer ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a raster layer.

Layers will either be taken from context's active project, or loaded from external sources and stored temporarily in the context. In either case, callers do not need to handle deletion of the returned layer.

Definition at line 577 of file qgsprocessingparameters.cpp.

◆ parameterAsRasterLayer() [2/2]

QgsRasterLayer * QgsProcessingParameters::parameterAsRasterLayer ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a raster layer.

Layers will either be taken from context's active project, or loaded from external sources and stored temporarily in the context. In either case, callers do not need to handle deletion of the returned layer.

Since
QGIS 3.4

Definition at line 582 of file qgsprocessingparameters.cpp.

◆ parameterAsSink() [1/2]

QgsFeatureSink * QgsProcessingParameters::parameterAsSink ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
const QgsFields fields,
QgsWkbTypes::Type  geometryType,
const QgsCoordinateReferenceSystem crs,
QgsProcessingContext context,
QString &  destinationIdentifier,
QgsFeatureSink::SinkFlags  sinkFlags = nullptr 
)
static

Evaluates the parameter with matching definition to a feature sink.

The fields, geometryType and crs parameters dictate the properties of the resulting feature sink.

Sinks will either be taken from context's active project, or created from external providers and stored temporarily in the context. The destinationIdentifier argument will be set to a string which can be used to retrieve the layer corresponding to the sink, e.g. via calling QgsProcessingUtils::mapLayerFromString().

This function creates a new object and the caller takes responsibility for deleting the returned object.

Definition at line 358 of file qgsprocessingparameters.cpp.

◆ parameterAsSink() [2/2]

QgsFeatureSink * QgsProcessingParameters::parameterAsSink ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
const QgsFields fields,
QgsWkbTypes::Type  geometryType,
const QgsCoordinateReferenceSystem crs,
QgsProcessingContext context,
QString &  destinationIdentifier,
QgsFeatureSink::SinkFlags  sinkFlags = nullptr 
)
static

Evaluates the parameter with matching definition and value to a feature sink.

The fields, geometryType and crs parameters dictate the properties of the resulting feature sink.

Sinks will either be taken from context's active project, or created from external providers and stored temporarily in the context. The destinationIdentifier argument will be set to a string which can be used to retrieve the layer corresponding to the sink, e.g. via calling QgsProcessingUtils::mapLayerFromString().

This function creates a new object and the caller takes responsibility for deleting the returned object.

Since
QGIS 3.4

Definition at line 371 of file qgsprocessingparameters.cpp.

◆ parameterAsSource() [1/2]

QgsProcessingFeatureSource * QgsProcessingParameters::parameterAsSource ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a feature source.

Sources will either be taken from context's active project, or loaded from external sources and stored temporarily in the context.

This function creates a new object and the caller takes responsibility for deleting the returned object.

Definition at line 435 of file qgsprocessingparameters.cpp.

◆ parameterAsSource() [2/2]

QgsProcessingFeatureSource * QgsProcessingParameters::parameterAsSource ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a feature source.

Sources will either be taken from context's active project, or loaded from external sources and stored temporarily in the context.

This function creates a new object and the caller takes responsibility for deleting the returned object.

Since
QGIS 3.4

Definition at line 443 of file qgsprocessingparameters.cpp.

◆ parameterAsString() [1/2]

QString QgsProcessingParameters::parameterAsString ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a static string value.

Definition at line 62 of file qgsprocessingparameters.cpp.

◆ parameterAsString() [2/2]

QString QgsProcessingParameters::parameterAsString ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
const QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a static string value.

Since
QGIS 3.4

Definition at line 70 of file qgsprocessingparameters.cpp.

◆ parameterAsVectorLayer() [1/2]

QgsVectorLayer * QgsProcessingParameters::parameterAsVectorLayer ( const QgsProcessingParameterDefinition definition,
const QVariantMap &  parameters,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition to a vector layer.

Layers will either be taken from context's active project, or loaded from external sources and stored temporarily in the context. In either case, callers do not need to handle deletion of the returned layer.

Definition at line 709 of file qgsprocessingparameters.cpp.

◆ parameterAsVectorLayer() [2/2]

QgsVectorLayer * QgsProcessingParameters::parameterAsVectorLayer ( const QgsProcessingParameterDefinition definition,
const QVariant &  value,
QgsProcessingContext context 
)
static

Evaluates the parameter with matching definition and value to a vector layer.

Layers will either be taken from context's active project, or loaded from external sources and stored temporarily in the context. In either case, callers do not need to handle deletion of the returned layer.

Since
QGIS 3.4

Definition at line 714 of file qgsprocessingparameters.cpp.

◆ parameterFromScriptCode()

QgsProcessingParameterDefinition * QgsProcessingParameters::parameterFromScriptCode ( const QString &  code)
static

Creates a new QgsProcessingParameterDefinition using the configuration from a supplied script code string.

The caller takes responsibility for deleting the returned object.

Definition at line 1543 of file qgsprocessingparameters.cpp.

◆ parameterFromVariantMap()

QgsProcessingParameterDefinition * QgsProcessingParameters::parameterFromVariantMap ( const QVariantMap &  map)
static

Creates a new QgsProcessingParameterDefinition using the configuration from a supplied variant map.

The caller takes responsibility for deleting the returned object.

Definition at line 1467 of file qgsprocessingparameters.cpp.


The documentation for this class was generated from the following files: