qgisExpressionUtils
in package
Tags
Table of Contents
Methods
- evaluateExpressions() : null|object
- Request QGIS Server and the lizmap plugin to evaluate QGIS expressions.
- evaluateGroupVisibilities() : array<string|int, mixed>
- Return form group visibilities.
- getCriteriaFromExpression() : array<string|int, mixed>
- Returns criteria dependencies (fields) for a QGIS expression.
- getCriteriaFromExpressions() : array<string|int, mixed>
- Returns criteria dependencies (fields) for QGIS expressions.
- getCurrentValueCriteriaFromExpression() : array<string|int, mixed>
- Returns criteria dependencies (fields) in current_value() for QGIS expression.
- getExpressionByUser() : string
- Returns the expression used to filter by login the layer.
- getFeatureWithFormScope() : array<string|int, mixed>
- Request QGIS Server to provide features with a form scope used for drilling down select.
- hasCurrentGeometry() : bool
- Returns true if @current_geometry is in the QGIS expression.
- replaceExpressionText() : null|object
- Request QGIS Server and the lizmap plugin to replace QGIS expressions text.
- updateExpressionByUser() : string
- Returns the expression updated if filter by login is applied for the layer.
- virtualFields() : null|array<string|int, mixed>
- Request QGIS Server and the lizmap plugin calculate virtual fields for the features of a given vector layer.
- request() : null|object
- Performing the request to QGIS Server.
Methods
evaluateExpressions()
Request QGIS Server and the lizmap plugin to evaluate QGIS expressions.
public
static evaluateExpressions(qgisVectorLayer $layer, array<string|int, mixed> $expressions[, array<string|int, mixed> $form_feature = null ]) : null|object
Parameters
- $layer : qgisVectorLayer
-
A QGIS vector layer
- $expressions : array<string|int, mixed>
-
The expressions' list to evaluate
- $form_feature : array<string|int, mixed> = null
-
A feature to add to the evaluation context
Return values
null|object —the results of expressions' evaluation
evaluateGroupVisibilities()
Return form group visibilities.
public
static evaluateGroupVisibilities(qgisAttributeEditorElement $attributeEditorForm, jFormsBase $form) : array<string|int, mixed>
Parameters
- $attributeEditorForm : qgisAttributeEditorElement
- $form : jFormsBase
Return values
array<string|int, mixed> —visibilities, an associated array with group html id as key and boolean as value
getCriteriaFromExpression()
Returns criteria dependencies (fields) for a QGIS expression.
public
static getCriteriaFromExpression(string $exp) : array<string|int, mixed>
Parameters
- $exp : string
-
A QGIS expression string
Return values
array<string|int, mixed> —The list of criteria dependencies
getCriteriaFromExpressions()
Returns criteria dependencies (fields) for QGIS expressions.
public
static getCriteriaFromExpressions(array<string|int, mixed> $expressions) : array<string|int, mixed>
Parameters
- $expressions : array<string|int, mixed>
-
list of QGIS expressions
Return values
array<string|int, mixed> —The list of criteria dependencies
getCurrentValueCriteriaFromExpression()
Returns criteria dependencies (fields) in current_value() for QGIS expression.
public
static getCurrentValueCriteriaFromExpression(string $exp) : array<string|int, mixed>
Parameters
- $exp : string
-
A QGIS expression string
Return values
array<string|int, mixed> —The list of criteria dependencies
getExpressionByUser()
Returns the expression used to filter by login the layer.
public
static getExpressionByUser(qgisVectorLayer $layer[, bool $edition = false ]) : string
This method combines the attribute and the spatial filter expressions.
Parameters
- $layer : qgisVectorLayer
-
A QGIS vector layer
- $edition : bool = false
-
It's for editing
Return values
string —the expression to filter by login the layer
getFeatureWithFormScope()
Request QGIS Server to provide features with a form scope used for drilling down select.
public
static getFeatureWithFormScope(qgisVectorLayer $layer, mixed $expression, array<string|int, mixed> $form_feature, array<string|int, mixed> $fields[, bool $edition = false ]) : array<string|int, mixed>
Parameters
- $layer : qgisVectorLayer
-
A QGIS vector layer
- $expression : mixed
- $form_feature : array<string|int, mixed>
-
The feature in the form
- $fields : array<string|int, mixed>
-
List of requested fields
- $edition : bool = false
-
It's for edition
Return values
array<string|int, mixed> —the features filtered with a form scope
hasCurrentGeometry()
Returns true if @current_geometry is in the QGIS expression.
public
static hasCurrentGeometry(string $exp) : bool
Parameters
- $exp : string
-
A QGIS expression string
Return values
bool —@current_geometry is in the QGIS expression
replaceExpressionText()
Request QGIS Server and the lizmap plugin to replace QGIS expressions text.
public
static replaceExpressionText(qgisVectorLayer $layer, array<string|int, mixed> $expressions[, array<string|int, mixed> $form_feature = null ]) : null|object
Parameters
- $layer : qgisVectorLayer
-
A QGIS vector layer
- $expressions : array<string|int, mixed>
-
The expressions text to replace
- $form_feature : array<string|int, mixed> = null
-
A feature to add to the evaluation context
Return values
null|object —the results of expressions text replacement
updateExpressionByUser()
Returns the expression updated if filter by login is applied for the layer.
public
static updateExpressionByUser(qgisVectorLayer $layer, string $expression[, bool $edition = false ]) : string
Parameters
- $layer : qgisVectorLayer
-
A QGIS vector layer
- $expression : string
-
The expression to update
- $edition : bool = false
-
It's for edition
Return values
string —the expression updated or not
virtualFields()
Request QGIS Server and the lizmap plugin calculate virtual fields for the features of a given vector layer.
public
static virtualFields(qgisVectorLayer $layer, array<string|int, mixed> $virtualFields[, string $filter = null ][, string $withGeometry = 'true' ][, string $fields = '' ]) : null|array<string|int, mixed>
A filter can be used to retrieve the virtual fields values only for a subset of features.
Parameters
- $layer : qgisVectorLayer
-
A QGIS vector layer
- $virtualFields : array<string|int, mixed>
-
The expressions' list to evaluate as key
- $filter : string = null
-
A filter to restrict virtual fields creation
- $withGeometry : string = 'true'
-
'true' to get geometries of features
- $fields : string = ''
-
A list of field names separated by comma. E.g. 'name,code'
Return values
null|array<string|int, mixed> —the features with virtual fields
request()
Performing the request to QGIS Server.
protected
static request(array<string|int, mixed> $params, Project|qgisProject $project) : null|object
Parameters
- $params : array<string|int, mixed>
- $project : Project|qgisProject
Return values
null|object —The response content or null