QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsogcutils.h
Go to the documentation of this file.
1 #ifndef QGSOGCUTILS_H
2 #define QGSOGCUTILS_H
3 
4 class QColor;
5 class QDomNode;
6 class QDomElement;
7 class QDomDocument;
8 class QString;
9 
10 #include <list>
11 #include <QVector>
12 
13 class QgsExpression;
14 class QgsGeometry;
15 class QgsPoint;
16 class QgsRectangle;
17 
18 #include "qgsgeometry.h"
19 #include "qgsexpression.h"
20 
30 class CORE_EXPORT QgsOgcUtils
31 {
32  public:
33 
39  static QgsGeometry* geometryFromGML( const QString& xmlString );
40 
43  static QgsGeometry* geometryFromGML( const QDomNode& geometryNode );
44 
46  static QgsRectangle rectangleFromGMLBox( const QDomNode& boxNode );
47 
49  static QgsRectangle rectangleFromGMLEnvelope( const QDomNode& envelopeNode );
50 
54  static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString format );
55 
59  static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc );
60 
64  static QDomElement rectangleToGMLBox( QgsRectangle* box, QDomDocument& doc );
65 
69  static QDomElement rectangleToGMLEnvelope( QgsRectangle* env, QDomDocument& doc );
70 
71 
73  static QColor colorFromOgcFill( const QDomElement& fillElement );
74 
76  static QgsExpression* expressionFromOgcFilter( const QDomElement& element );
77 
83  static QDomElement expressionToOgcFilter( const QgsExpression& exp, QDomDocument& doc, QString* errorMessage = 0 );
84 
85  private:
87  static QgsGeometry* geometryFromGMLPoint( const QDomElement& geometryElement );
89  static QgsGeometry* geometryFromGMLLineString( const QDomElement& geometryElement );
91  static QgsGeometry* geometryFromGMLPolygon( const QDomElement& geometryElement );
93  static QgsGeometry* geometryFromGMLMultiPoint( const QDomElement& geometryElement );
95  static QgsGeometry* geometryFromGMLMultiLineString( const QDomElement& geometryElement );
97  static QgsGeometry* geometryFromGMLMultiPolygon( const QDomElement& geometryElement );
102  static bool readGMLCoordinates( QgsPolyline &coords, const QDomElement &elem );
109  static bool readGMLPositions( QgsPolyline &coords, const QDomElement &elem );
110 
111 
116  static QDomElement createGMLCoordinates( const QgsPolyline &points, QDomDocument& doc );
117 
122  static QDomElement createGMLPositions( const QgsPolyline &points, QDomDocument& doc );
123 
125  static QgsExpression::Node* nodeFromOgcFilter( QDomElement &element, QString &errorMessage );
127  static QgsExpression::NodeBinaryOperator* nodeBinaryOperatorFromOgcFilter( QDomElement &element, QString &errorMessage );
129  static QgsExpression::NodeFunction* nodeSpatialOperatorFromOgcFilter( QDomElement& element, QString& errorMessage );
131  static QgsExpression::NodeUnaryOperator* nodeNotFromOgcFilter( QDomElement &element, QString &errorMessage );
133  static QgsExpression::NodeFunction* nodeFunctionFromOgcFilter( QDomElement &element, QString &errorMessage );
135  static QgsExpression::Node* nodeLiteralFromOgcFilter( QDomElement &element, QString &errorMessage );
137  static QgsExpression::NodeColumnRef* nodeColumnRefFromOgcFilter( QDomElement &element, QString &errorMessage );
139  static QgsExpression::Node* nodeIsBetweenFromOgcFilter( QDomElement& element, QString& errorMessage );
141  static QgsExpression::NodeBinaryOperator* nodePropertyIsNullFromOgcFilter( QDomElement& element, QString& errorMessage );
142 
143  static QDomElement expressionNodeToOgcFilter( const QgsExpression::Node* node, QDomDocument& doc, QString& errorMessage );
144  static QDomElement expressionUnaryOperatorToOgcFilter( const QgsExpression::NodeUnaryOperator* node, QDomDocument& doc, QString& errorMessage );
145  static QDomElement expressionBinaryOperatorToOgcFilter( const QgsExpression::NodeBinaryOperator* node, QDomDocument& doc, QString& errorMessage );
146  static QDomElement expressionLiteralToOgcFilter( const QgsExpression::NodeLiteral* node, QDomDocument& doc, QString& errorMessage );
147  static QDomElement expressionColumnRefToOgcFilter( const QgsExpression::NodeColumnRef* node, QDomDocument& doc, QString& errorMessage );
148  static QDomElement expressionInOperatorToOgcFilter( const QgsExpression::NodeInOperator* node, QDomDocument& doc, QString& errorMessage );
149  static QDomElement expressionFunctionToOgcFilter( const QgsExpression::NodeFunction* node, QDomDocument& doc, QString& errorMessage );
150 
151 };
152 
153 #endif // QGSOGCUTILS_H