Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Sep 13, 2018
1 parent 38fc046 commit a99b520
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/core/auto_generated/qgsogcutils.sip.in
Expand Up @@ -150,6 +150,15 @@ according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT)
};

static QgsExpression *expressionFromOgcFilter( const QDomElement &element, FilterVersion version, QgsVectorLayer *layer = 0 ) /Factory/;
%Docstring
Returns an expression from a WFS filter embedded in a document.

:param element: The WFS Filter
:param version: The WFS version
:param layer: Layer to use to retrieve field values from literal filters

.. versionadded:: 3.4
%End


static QDomElement expressionToOgcExpression( const QgsExpression &exp, QDomDocument &doc, QString *errorMessage = 0 );
Expand Down
68 changes: 68 additions & 0 deletions src/core/qgsogcutils.h
Expand Up @@ -161,6 +161,13 @@ class CORE_EXPORT QgsOgcUtils
FILTER_FES_2_0
};

/**
* Returns an expression from a WFS filter embedded in a document.
* \param element The WFS Filter
* \param version The WFS version
* \param layer Layer to use to retrieve field values from literal filters
* \since QGIS 3.4
*/
static QgsExpression *expressionFromOgcFilter( const QDomElement &element, FilterVersion version, QgsVectorLayer *layer = nullptr ) SIP_FACTORY;

/**
Expand Down Expand Up @@ -369,23 +376,84 @@ class QgsOgcUtilsExprToFilter
QDomElement expressionFunctionToOgcFilter( const QgsExpressionNodeFunction *node, QgsExpression *expression, const QgsExpressionContext *context );
};

/**
* \ingroup core
* \brief Internal use by QgsOgcUtils
* \note not available in Python bindings
* \since QGIS 3.4
*/
class QgsOgcUtilsExprFromFilter
{
public:

/**
* Constructor for QgsOgcUtilsExprFromFilter.
* \param version WFS Version
* \param layer Layer to use to retrieve field values from literal filters
*/
QgsOgcUtilsExprFromFilter( QgsOgcUtils::FilterVersion version = QgsOgcUtils::FILTER_OGC_1_0,
QgsVectorLayer *layer = nullptr );

/**
* Returns an expression node from a WFS filter embedded in a document
* element. A null pointer is returned when an error happened.
* \param element The WFS filter
*/
QgsExpressionNode *nodeFromOgcFilter( const QDomElement &element );

/**
* Returns the underlying error message, or an empty string in case of no
* error.
*/
QString errorMessage() const;

/**
* Returns an expression node from a WFS filter embedded in a document with
* binary operators.
*
*/
QgsExpressionNodeBinaryOperator *nodeBinaryOperatorFromOgcFilter( const QDomElement &element );

/**
* Returns an expression node from a WFS filter embedded in a document with
* spatial operators.
*/
QgsExpressionNodeFunction *nodeSpatialOperatorFromOgcFilter( const QDomElement &element );

/**
* Returns an expression node from a WFS filter embedded in a document with
* column references.
*/
QgsExpressionNodeColumnRef *nodeColumnRefFromOgcFilter( const QDomElement &element );

/**
* Returns an expression node from a WFS filter embedded in a document with
* literal tag.
*/
QgsExpressionNode *nodeLiteralFromOgcFilter( const QDomElement &element );

/**
* Returns an expression node from a WFS filter embedded in a document with
* Not operator.
*/
QgsExpressionNodeUnaryOperator *nodeNotFromOgcFilter( const QDomElement &element );

/**
* Returns an expression node from a WFS filter embedded in a document with
* IsNull operator.
*/
QgsExpressionNodeBinaryOperator *nodePropertyIsNullFromOgcFilter( const QDomElement &element );

/**
* Returns an expression node from a WFS filter embedded in a document with
* functions.
*/
QgsExpressionNodeFunction *nodeFunctionFromOgcFilter( const QDomElement &element );

/**
* Returns an expression node from a WFS filter embedded in a document with
* boudnaries operator.
*/
QgsExpressionNode *nodeIsBetweenFromOgcFilter( const QDomElement &element );

private:
Expand Down

0 comments on commit a99b520

Please sign in to comment.