QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
Performs mesh layer calculations. More...
#include <qgsmeshcalculator.h>
Public Types | |
enum | Result { Success = 0 , Canceled , CreateOutputError , InputLayerError , ParserError , InvalidDatasets , EvaluateError , MemoryError } |
Result of the calculation. More... | |
Public Member Functions | |
QgsMeshCalculator (const QString &formulaString, const QString &outputDriver, const QString &outputGroupName, const QString &outputFile, const QgsGeometry &outputMask, double startTime, double endTime, QgsMeshLayer *layer) | |
Creates calculator with geometry mask. More... | |
QgsMeshCalculator (const QString &formulaString, const QString &outputDriver, const QString &outputGroupName, const QString &outputFile, const QgsRectangle &outputExtent, double startTime, double endTime, QgsMeshLayer *layer) | |
Creates calculator with bounding box (rectangular) mask. More... | |
Q_DECL_DEPRECATED | QgsMeshCalculator (const QString &formulaString, const QString &outputFile, const QgsGeometry &outputMask, double startTime, double endTime, QgsMeshLayer *layer) |
Creates calculator with geometry mask. More... | |
Q_DECL_DEPRECATED | QgsMeshCalculator (const QString &formulaString, const QString &outputFile, const QgsRectangle &outputExtent, double startTime, double endTime, QgsMeshLayer *layer) |
Creates calculator with bounding box (rectangular) mask. More... | |
QgsMeshCalculator (const QString &formulaString, const QString &outputGroupName, const QgsGeometry &outputMask, const QgsMeshDatasetGroup::Type &destination, QgsMeshLayer *layer, double startTime, double endTime) | |
Creates calculator with with geometry mask, store the result in destination (must be on memory or virtual), see QgsMeshCalculator::Destination. More... | |
QgsMeshCalculator (const QString &formulaString, const QString &outputGroupName, const QgsRectangle &outputExtent, const QgsMeshDatasetGroup::Type &destination, QgsMeshLayer *layer, double startTime, double endTime) | |
Creates calculator with bounding box (rectangular) mask, store the result in destination (must be on memory or virtual), see QgsMeshCalculator::Destination. More... | |
Result | processCalculation (QgsFeedback *feedback=nullptr) |
Starts the calculation, creates new dataset group and adds it to the mesh layer. More... | |
Static Public Member Functions | |
static Q_DECL_DEPRECATED Result | expression_valid (const QString &formulaString, QgsMeshLayer *layer) |
Returns whether formula is valid for particular mesh layer. More... | |
static Result | expressionIsValid (const QString &formulaString, QgsMeshLayer *layer, QgsMeshDriverMetadata::MeshDriverCapability &requiredCapability) |
Returns whether formula is valid for particular mesh layer. More... | |
Performs mesh layer calculations.
Mesh calculator can do various mathematical operations between dataset groups from a single mesh layer. Resulting dataset group is added to the mesh layer. Result can be filtered by extent or a vector layer mask spatially and by selection of times.
Resulting dataset is always scalar
Definition at line 48 of file qgsmeshcalculator.h.
Result of the calculation.
Definition at line 53 of file qgsmeshcalculator.h.
QgsMeshCalculator::QgsMeshCalculator | ( | const QString & | formulaString, |
const QString & | outputFile, | ||
const QgsRectangle & | outputExtent, | ||
double | startTime, | ||
double | endTime, | ||
QgsMeshLayer * | layer | ||
) |
Creates calculator with bounding box (rectangular) mask.
formulaString | formula/expression to evaluate. Consists of dataset group names, operators and numbers |
outputFile | file to store the resulting dataset group data |
outputExtent | spatial filter defined by rectangle |
startTime | time filter defining the starting dataset |
endTime | time filter defining the ending dataset |
layer | mesh layer with dataset groups references in formulaString |
Definition at line 29 of file qgsmeshcalculator.cpp.
QgsMeshCalculator::QgsMeshCalculator | ( | const QString & | formulaString, |
const QString & | outputFile, | ||
const QgsGeometry & | outputMask, | ||
double | startTime, | ||
double | endTime, | ||
QgsMeshLayer * | layer | ||
) |
Creates calculator with geometry mask.
formulaString | formula/expression to evaluate. Consists of dataset group names, operators and numbers |
outputFile | file to store the resulting dataset group data |
outputMask | spatial filter defined by geometry |
startTime | time filter defining the starting dataset |
endTime | time filter defining the ending dataset |
layer | mesh layer with dataset groups references in formulaString |
Definition at line 48 of file qgsmeshcalculator.cpp.
QgsMeshCalculator::QgsMeshCalculator | ( | const QString & | formulaString, |
const QString & | outputDriver, | ||
const QString & | outputGroupName, | ||
const QString & | outputFile, | ||
const QgsRectangle & | outputExtent, | ||
double | startTime, | ||
double | endTime, | ||
QgsMeshLayer * | layer | ||
) |
Creates calculator with bounding box (rectangular) mask.
formulaString | formula/expression to evaluate. Consists of dataset group names, operators and numbers |
outputDriver | output driver name |
outputGroupName | output group name |
outputFile | file to store the resulting dataset group data |
outputExtent | spatial filter defined by rectangle |
startTime | time filter defining the starting dataset |
endTime | time filter defining the ending dataset |
layer | mesh layer with dataset groups references in formulaString |
Definition at line 68 of file qgsmeshcalculator.cpp.
QgsMeshCalculator::QgsMeshCalculator | ( | const QString & | formulaString, |
const QString & | outputDriver, | ||
const QString & | outputGroupName, | ||
const QString & | outputFile, | ||
const QgsGeometry & | outputMask, | ||
double | startTime, | ||
double | endTime, | ||
QgsMeshLayer * | layer | ||
) |
Creates calculator with geometry mask.
formulaString | formula/expression to evaluate. Consists of dataset group names, operators and numbers |
outputDriver | output driver name |
outputGroupName | output group name |
outputFile | file to store the resulting dataset group data |
outputMask | spatial filter defined by geometry |
startTime | time filter defining the starting dataset |
endTime | time filter defining the ending dataset |
layer | mesh layer with dataset groups references in formulaString |
Definition at line 89 of file qgsmeshcalculator.cpp.
QgsMeshCalculator::QgsMeshCalculator | ( | const QString & | formulaString, |
const QString & | outputGroupName, | ||
const QgsRectangle & | outputExtent, | ||
const QgsMeshDatasetGroup::Type & | destination, | ||
QgsMeshLayer * | layer, | ||
double | startTime, | ||
double | endTime | ||
) |
Creates calculator with bounding box (rectangular) mask, store the result in destination (must be on memory or virtual), see QgsMeshCalculator::Destination.
formulaString | formula/expression to evaluate. Consists of dataset group names, operators and numbers |
outputGroupName | output group name |
outputExtent | spatial filter defined by rectangle |
destination | destination of the calculation (memory or virtual) |
startTime | time filter defining the starting dataset |
endTime | time filter defining the ending dataset |
layer | mesh layer with dataset groups references in formulaString |
Definition at line 110 of file qgsmeshcalculator.cpp.
QgsMeshCalculator::QgsMeshCalculator | ( | const QString & | formulaString, |
const QString & | outputGroupName, | ||
const QgsGeometry & | outputMask, | ||
const QgsMeshDatasetGroup::Type & | destination, | ||
QgsMeshLayer * | layer, | ||
double | startTime, | ||
double | endTime | ||
) |
Creates calculator with with geometry mask, store the result in destination (must be on memory or virtual), see QgsMeshCalculator::Destination.
formulaString | formula/expression to evaluate. Consists of dataset group names, operators and numbers |
outputGroupName | output group name |
outputMask | spatial filter defined by geometry |
destination | destination of the calculation (memory or virtual) |
startTime | time filter defining the starting dataset |
endTime | time filter defining the ending dataset |
layer | mesh layer with dataset groups references in formulaString |
Definition at line 128 of file qgsmeshcalculator.cpp.
|
static |
Returns whether formula is valid for particular mesh layer.
formulaString | formula/expression to evaluate. Consists of dataset group names, operators and numbers |
layer | mesh layer with dataset groups references in formulaString |
Definition at line 146 of file qgsmeshcalculator.cpp.
|
static |
Returns whether formula is valid for particular mesh layer.
formulaString | formula/expression to evaluate. Consists of dataset group names, operators and numbers |
layer | mesh layer with dataset groups references in formulaString |
requiredCapability | returns required capability of driver to store results of the calculation |
Definition at line 154 of file qgsmeshcalculator.cpp.
QgsMeshCalculator::Result QgsMeshCalculator::processCalculation | ( | QgsFeedback * | feedback = nullptr | ) |
Starts the calculation, creates new dataset group and adds it to the mesh layer.
feedback | The optional feedback argument for progress reporting and cancellation support |
Definition at line 175 of file qgsmeshcalculator.cpp.