QGIS API Documentation  2.15.0-Master (af20121)
Classes | Public Types | Static Public Member Functions | List of all members
QgsOgcUtils Class Reference

The QgsOgcUtils class provides various utility functions for conversion between OGC (Open Geospatial Consortium) standards and QGIS internal representations. More...

#include <qgsogcutils.h>

Classes

class  LayerProperties
 Layer properties. More...
 

Public Types

enum  FilterVersion { FILTER_OGC_1_0, FILTER_OGC_1_1, FILTER_FES_2_0 }
 OGC filter version. More...
 
enum  GMLVersion { GML_2_1_2, GML_3_1_0, GML_3_2_1 }
 GML version. More...
 

Static Public Member Functions

static QColor colorFromOgcFill (const QDomElement &fillElement)
 Parse XML with OGC fill into QColor. More...
 
static QgsExpressionexpressionFromOgcFilter (const QDomElement &element)
 Parse XML with OGC filter into QGIS expression. More...
 
static QDomElement expressionToOgcFilter (const QgsExpression &exp, QDomDocument &doc, QString *errorMessage=nullptr)
 Creates OGC filter XML element. More...
 
static QDomElement expressionToOgcFilter (const QgsExpression &exp, QDomDocument &doc, GMLVersion gmlVersion, FilterVersion filterVersion, const QString &geometryName, const QString &srsName, bool honourAxisOrientation, bool invertAxisOrientation, QString *errorMessage=nullptr)
 Creates OGC filter XML element. More...
 
static QgsGeometrygeometryFromGML (const QString &xmlString)
 Static method that creates geometry from GML. More...
 
static QgsGeometrygeometryFromGML (const QDomNode &geometryNode)
 Static method that creates geometry from GML. More...
 
static QDomElement geometryToGML (const QgsGeometry *geometry, QDomDocument &doc, GMLVersion gmlVersion, const QString &srsName, bool invertAxisOrientation, const QString &gmlIdBase, int precision=17)
 Exports the geometry to GML. More...
 
static QDomElement geometryToGML (const QgsGeometry *geometry, QDomDocument &doc, const QString &format, int precision=17)
 Exports the geometry to GML2 or GML3. More...
 
static QDomElement geometryToGML (const QgsGeometry *geometry, QDomDocument &doc, int precision=17)
 Exports the geometry to GML2. More...
 
static QgsRectangle rectangleFromGMLBox (const QDomNode &boxNode)
 Read rectangle from GML2 Box. More...
 
static QgsRectangle rectangleFromGMLEnvelope (const QDomNode &envelopeNode)
 Read rectangle from GML3 Envelope. More...
 
static QDomElement rectangleToGMLBox (QgsRectangle *box, QDomDocument &doc, int precision=17)
 Exports the rectangle to GML2 Box. More...
 
static QDomElement rectangleToGMLBox (QgsRectangle *box, QDomDocument &doc, const QString &srsName, bool invertAxisOrientation, int precision=17)
 Exports the rectangle to GML2 Box. More...
 
static QDomElement rectangleToGMLEnvelope (QgsRectangle *env, QDomDocument &doc, int precision=17)
 Exports the rectangle to GML3 Envelope. More...
 
static QDomElement rectangleToGMLEnvelope (QgsRectangle *env, QDomDocument &doc, const QString &srsName, bool invertAxisOrientation, int precision=17)
 Exports the rectangle to GML3 Envelope. More...
 
static QDomElement SQLStatementToOgcFilter (const QgsSQLStatement &statement, QDomDocument &doc, GMLVersion gmlVersion, FilterVersion filterVersion, const QList< LayerProperties > &layerProperties, bool honourAxisOrientation, bool invertAxisOrientation, const QMap< QString, QString > &mapUnprefixedTypenameToPrefixedTypename, QString *errorMessage=nullptr)
 Creates OGC filter XML element from the WHERE and JOIN clauses of a SQL statement. More...
 

Detailed Description

The QgsOgcUtils class provides various utility functions for conversion between OGC (Open Geospatial Consortium) standards and QGIS internal representations.

Currently supported standards:

Definition at line 43 of file qgsogcutils.h.

Member Enumeration Documentation

OGC filter version.

Note
not available in Python bindings
Enumerator
FILTER_OGC_1_0 
FILTER_OGC_1_1 
FILTER_FES_2_0 

Definition at line 140 of file qgsogcutils.h.

GML version.

Note
not available in Python bindings
Enumerator
GML_2_1_2 
GML_3_1_0 
GML_3_2_1 

Definition at line 50 of file qgsogcutils.h.

Member Function Documentation

QColor QgsOgcUtils::colorFromOgcFill ( const QDomElement fillElement)
static

Parse XML with OGC fill into QColor.

Definition at line 1556 of file qgsogcutils.cpp.

QgsExpression * QgsOgcUtils::expressionFromOgcFilter ( const QDomElement element)
static

Parse XML with OGC filter into QGIS expression.

Definition at line 1595 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::expressionToOgcFilter ( const QgsExpression exp,
QDomDocument doc,
QString errorMessage = nullptr 
)
static

Creates OGC filter XML element.

Supports minimum standard filter according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT)

Returns
valid
<Filter> 
QDomElement on success, otherwise null QDomElement

Definition at line 2040 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::expressionToOgcFilter ( const QgsExpression exp,
QDomDocument doc,
GMLVersion  gmlVersion,
FilterVersion  filterVersion,
const QString geometryName,
const QString srsName,
bool  honourAxisOrientation,
bool  invertAxisOrientation,
QString errorMessage = nullptr 
)
static

Creates OGC filter XML element.

Supports minimum standard filter according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT)

Returns
valid
<Filter> 
QDomElement on success, otherwise null QDomElement
Note
Added in QGIS 2.16
not available in Python bindings

Definition at line 2046 of file qgsogcutils.cpp.

QgsGeometry * QgsOgcUtils::geometryFromGML ( const QString xmlString)
static

Static method that creates geometry from GML.

Parameters
xmlStringxml representation of the geometry. GML elements are expected to be in default namespace (
{<Point>...</Point> 
) or in "gml" namespace (
<gml:Point>...</gml:Point> 
)

Definition at line 130 of file qgsogcutils.cpp.

QgsGeometry * QgsOgcUtils::geometryFromGML ( const QDomNode geometryNode)
static

Static method that creates geometry from GML.

Definition at line 69 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::geometryToGML ( const QgsGeometry geometry,
QDomDocument doc,
GMLVersion  gmlVersion,
const QString srsName,
bool  invertAxisOrientation,
const QString gmlIdBase,
int  precision = 17 
)
static

Exports the geometry to GML.

Returns
QDomElement
Note
Added in QGIS 2.16

Definition at line 1125 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::geometryToGML ( const QgsGeometry geometry,
QDomDocument doc,
const QString format,
int  precision = 17 
)
static

Exports the geometry to GML2 or GML3.

Returns
QDomElement

Definition at line 1120 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::geometryToGML ( const QgsGeometry geometry,
QDomDocument doc,
int  precision = 17 
)
static

Exports the geometry to GML2.

Returns
QDomElement

Definition at line 1498 of file qgsogcutils.cpp.

QgsRectangle QgsOgcUtils::rectangleFromGMLBox ( const QDomNode boxNode)
static

Read rectangle from GML2 Box.

Definition at line 879 of file qgsogcutils.cpp.

QgsRectangle QgsOgcUtils::rectangleFromGMLEnvelope ( const QDomNode envelopeNode)
static

Read rectangle from GML3 Envelope.

Definition at line 960 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::rectangleToGMLBox ( QgsRectangle box,
QDomDocument doc,
int  precision = 17 
)
static

Exports the rectangle to GML2 Box.

Returns
QDomElement

Definition at line 1039 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::rectangleToGMLBox ( QgsRectangle box,
QDomDocument doc,
const QString srsName,
bool  invertAxisOrientation,
int  precision = 17 
)
static

Exports the rectangle to GML2 Box.

Returns
QDomElement
Note
Added in QGIS 2.16

Definition at line 1044 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::rectangleToGMLEnvelope ( QgsRectangle env,
QDomDocument doc,
int  precision = 17 
)
static

Exports the rectangle to GML3 Envelope.

Returns
QDomElement

Definition at line 1079 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::rectangleToGMLEnvelope ( QgsRectangle env,
QDomDocument doc,
const QString srsName,
bool  invertAxisOrientation,
int  precision = 17 
)
static

Exports the rectangle to GML3 Envelope.

Returns
QDomElement
Note
Added in QGIS 2.16

Definition at line 1084 of file qgsogcutils.cpp.

QDomElement QgsOgcUtils::SQLStatementToOgcFilter ( const QgsSQLStatement statement,
QDomDocument doc,
GMLVersion  gmlVersion,
FilterVersion  filterVersion,
const QList< LayerProperties > &  layerProperties,
bool  honourAxisOrientation,
bool  invertAxisOrientation,
const QMap< QString, QString > &  mapUnprefixedTypenameToPrefixedTypename,
QString errorMessage = nullptr 
)
static

Creates OGC filter XML element from the WHERE and JOIN clauses of a SQL statement.

Supports minimum standard filter according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT,LIKE,BETWEEN,IN) Supports layer joins. Supports ST_GeometryFromText(wkt[, srid/srsname]), ST_MakeEnvelope(xmin,ymin,xmax,ymax[, srid/srsname]) ST_GeomFromGML(serialized_gml_string) BBOX() ST_Intersects(), ST_Contains(), ST_Crosses(), ST_Equals(), ST_Disjoint(), ST_Overlaps(), ST_Touches(), ST_Within() ST_DWithin(), ST_Beyond() custom functions

Returns
valid
<Filter> 
QDomElement on success, otherwise null QDomElement
Note
Added in QGIS 2.16
not available in Python bindings

Definition at line 2083 of file qgsogcutils.cpp.


The documentation for this class was generated from the following files: