QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 
28 class CORE_EXPORT QgsOgcUtils
29 {
30  public:
31 
37  static QgsGeometry* geometryFromGML( const QString& xmlString );
38 
41  static QgsGeometry* geometryFromGML( const QDomNode& geometryNode );
42 
44  static QgsRectangle rectangleFromGMLBox( const QDomNode& boxNode );
45 
47  static QgsRectangle rectangleFromGMLEnvelope( const QDomNode& envelopeNode );
48 
52  static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString format, const int &precision = 17 );
53 
57  static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, const int &precision = 17 );
58 
62  static QDomElement rectangleToGMLBox( QgsRectangle* box, QDomDocument& doc, const int &precision = 17 );
63 
67  static QDomElement rectangleToGMLEnvelope( QgsRectangle* env, QDomDocument& doc, const int &precision = 17 );
68 
69 
71  static QColor colorFromOgcFill( const QDomElement& fillElement );
72 
74  static QgsExpression* expressionFromOgcFilter( const QDomElement& element );
75 
81  static QDomElement expressionToOgcFilter( const QgsExpression& exp, QDomDocument& doc, QString* errorMessage = 0 );
82 
83  private:
85  static QgsGeometry* geometryFromGMLPoint( const QDomElement& geometryElement );
87  static QgsGeometry* geometryFromGMLLineString( const QDomElement& geometryElement );
89  static QgsGeometry* geometryFromGMLPolygon( const QDomElement& geometryElement );
91  static QgsGeometry* geometryFromGMLMultiPoint( const QDomElement& geometryElement );
93  static QgsGeometry* geometryFromGMLMultiLineString( const QDomElement& geometryElement );
95  static QgsGeometry* geometryFromGMLMultiPolygon( const QDomElement& geometryElement );
100  static bool readGMLCoordinates( QgsPolyline &coords, const QDomElement &elem );
107  static bool readGMLPositions( QgsPolyline &coords, const QDomElement &elem );
108 
109 
114  static QDomElement createGMLCoordinates( const QgsPolyline &points, QDomDocument& doc );
115 
120  static QDomElement createGMLPositions( const QgsPolyline &points, QDomDocument& doc );
121 
123  static QgsExpression::Node* nodeFromOgcFilter( QDomElement &element, QString &errorMessage );
125  static QgsExpression::NodeBinaryOperator* nodeBinaryOperatorFromOgcFilter( QDomElement &element, QString &errorMessage );
127  static QgsExpression::NodeFunction* nodeSpatialOperatorFromOgcFilter( QDomElement& element, QString& errorMessage );
129  static QgsExpression::NodeUnaryOperator* nodeNotFromOgcFilter( QDomElement &element, QString &errorMessage );
131  static QgsExpression::NodeFunction* nodeFunctionFromOgcFilter( QDomElement &element, QString &errorMessage );
133  static QgsExpression::Node* nodeLiteralFromOgcFilter( QDomElement &element, QString &errorMessage );
135  static QgsExpression::NodeColumnRef* nodeColumnRefFromOgcFilter( QDomElement &element, QString &errorMessage );
137  static QgsExpression::Node* nodeIsBetweenFromOgcFilter( QDomElement& element, QString& errorMessage );
139  static QgsExpression::NodeBinaryOperator* nodePropertyIsNullFromOgcFilter( QDomElement& element, QString& errorMessage );
140 
141  static QDomElement expressionNodeToOgcFilter( const QgsExpression::Node* node, QDomDocument& doc, QString& errorMessage );
142  static QDomElement expressionUnaryOperatorToOgcFilter( const QgsExpression::NodeUnaryOperator* node, QDomDocument& doc, QString& errorMessage );
143  static QDomElement expressionBinaryOperatorToOgcFilter( const QgsExpression::NodeBinaryOperator* node, QDomDocument& doc, QString& errorMessage );
144  static QDomElement expressionLiteralToOgcFilter( const QgsExpression::NodeLiteral* node, QDomDocument& doc, QString& errorMessage );
145  static QDomElement expressionColumnRefToOgcFilter( const QgsExpression::NodeColumnRef* node, QDomDocument& doc, QString& errorMessage );
146  static QDomElement expressionInOperatorToOgcFilter( const QgsExpression::NodeInOperator* node, QDomDocument& doc, QString& errorMessage );
147  static QDomElement expressionFunctionToOgcFilter( const QgsExpression::NodeFunction* node, QDomDocument& doc, QString& errorMessage );
148 
149 };
150 
151 #endif // QGSOGCUTILS_H
Class for parsing and evaluation of expressions (formerly called "search strings").
Definition: qgsexpression.h:87
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QVector< QgsPoint > QgsPolyline
polyline is represented as a vector of points
Definition: qgsgeometry.h:33
A class to represent a point.
Definition: qgspoint.h:63
The QgsOgcUtils class provides various utility functions for conversion between OGC (Open Geospatial ...
Definition: qgsogcutils.h:28