QGIS API Documentation  2.0.1-Dufour
 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 QDomNode;
5 class QDomElement;
6 class QDomDocument;
7 class QString;
8 
9 #include <list>
10 #include <QVector>
11 
12 class QgsExpression;
13 class QgsGeometry;
14 class QgsPoint;
15 class QgsRectangle;
16 
17 #include "qgsgeometry.h"
18 #include "qgsexpression.h"
19 
29 class CORE_EXPORT QgsOgcUtils
30 {
31  public:
32 
38  static QgsGeometry* geometryFromGML( const QString& xmlString );
39 
42  static QgsGeometry* geometryFromGML( const QDomNode& geometryNode );
43 
45  static QgsRectangle rectangleFromGMLBox( const QDomNode& boxNode );
46 
48  static QgsRectangle rectangleFromGMLEnvelope( const QDomNode& envelopeNode );
49 
53  static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString format );
54 
58  static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc );
59 
63  static QDomElement rectangleToGMLBox( QgsRectangle* box, QDomDocument& doc );
64 
68  static QDomElement rectangleToGMLEnvelope( QgsRectangle* env, QDomDocument& doc );
69 
70 
72  static QgsExpression* expressionFromOgcFilter( const QDomElement& element );
73 
79  static QDomElement expressionToOgcFilter( const QgsExpression& exp, QDomDocument& doc, QString* errorMessage = 0 );
80 
81  private:
83  static QgsGeometry* geometryFromGMLPoint( const QDomElement& geometryElement );
85  static QgsGeometry* geometryFromGMLLineString( const QDomElement& geometryElement );
87  static QgsGeometry* geometryFromGMLPolygon( const QDomElement& geometryElement );
89  static QgsGeometry* geometryFromGMLMultiPoint( const QDomElement& geometryElement );
91  static QgsGeometry* geometryFromGMLMultiLineString( const QDomElement& geometryElement );
93  static QgsGeometry* geometryFromGMLMultiPolygon( const QDomElement& geometryElement );
98  static bool readGMLCoordinates( QgsPolyline &coords, const QDomElement elem );
105  static bool readGMLPositions( QgsPolyline &coords, const QDomElement elem );
106 
107 
112  static QDomElement createGMLCoordinates( const QgsPolyline &points, QDomDocument& doc );
113 
118  static QDomElement createGMLPositions( const QgsPolyline &points, QDomDocument& doc );
119 
121  static QgsExpression::Node* nodeFromOgcFilter( QDomElement &element, QString &errorMessage );
123  static QgsExpression::NodeBinaryOperator* nodeBinaryOperatorFromOgcFilter( QDomElement &element, QString &errorMessage );
125  static QgsExpression::NodeFunction* nodeSpatialOperatorFromOgcFilter( QDomElement& element, QString& errorMessage );
127  static QgsExpression::NodeUnaryOperator* nodeNotFromOgcFilter( QDomElement &element, QString &errorMessage );
129  static QgsExpression::NodeFunction* nodeFunctionFromOgcFilter( QDomElement &element, QString &errorMessage );
131  static QgsExpression::Node* nodeLiteralFromOgcFilter( QDomElement &element, QString &errorMessage );
133  static QgsExpression::NodeColumnRef* nodeColumnRefFromOgcFilter( QDomElement &element, QString &errorMessage );
135  static QgsExpression::Node* nodeIsBetweenFromOgcFilter( QDomElement& element, QString& errorMessage );
137  static QgsExpression::NodeBinaryOperator* nodePropertyIsNullFromOgcFilter( QDomElement& element, QString& errorMessage );
138 
139  static QDomElement expressionNodeToOgcFilter( const QgsExpression::Node* node, QDomDocument& doc, QString& errorMessage );
140  static QDomElement expressionUnaryOperatorToOgcFilter( const QgsExpression::NodeUnaryOperator* node, QDomDocument& doc, QString& errorMessage );
141  static QDomElement expressionBinaryOperatorToOgcFilter( const QgsExpression::NodeBinaryOperator* node, QDomDocument& doc, QString& errorMessage );
142  static QDomElement expressionLiteralToOgcFilter( const QgsExpression::NodeLiteral* node, QDomDocument& doc, QString& errorMessage );
143  static QDomElement expressionColumnRefToOgcFilter( const QgsExpression::NodeColumnRef* node, QDomDocument& doc, QString& errorMessage );
144  static QDomElement expressionInOperatorToOgcFilter( const QgsExpression::NodeInOperator* node, QDomDocument& doc, QString& errorMessage );
145  static QDomElement expressionFunctionToOgcFilter( const QgsExpression::NodeFunction* node, QDomDocument& doc, QString& errorMessage );
146 
147 };
148 
149 #endif // QGSOGCUTILS_H