QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Static Public Member Functions | Static Private 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>

Static Public Member Functions

static QgsGeometrygeometryFromGML (const QString &xmlString)
 static method that creates geometry from GML
static QgsGeometrygeometryFromGML (const QDomNode &geometryNode)
 static method that creates geometry from GML
static QgsRectangle rectangleFromGMLBox (const QDomNode &boxNode)
 read rectangle from GML2 Box
static QgsRectangle rectangleFromGMLEnvelope (const QDomNode &envelopeNode)
 read rectangle from GML3 Envelope
static QDomElement geometryToGML (QgsGeometry *geometry, QDomDocument &doc, QString format)
 Exports the geometry to GML2 or GML3.
static QDomElement geometryToGML (QgsGeometry *geometry, QDomDocument &doc)
 Exports the geometry to GML2.
static QDomElement rectangleToGMLBox (QgsRectangle *box, QDomDocument &doc)
 Exports the rectangle to GML2 Box.
static QDomElement rectangleToGMLEnvelope (QgsRectangle *env, QDomDocument &doc)
 Exports the rectangle to GML2 Envelope.
static QColor colorFromOgcFill (const QDomElement &fillElement)
 Parse XML with OGC fill into QColor.
static QgsExpressionexpressionFromOgcFilter (const QDomElement &element)
 Parse XML with OGC filter into QGIS expression.
static QDomElement expressionToOgcFilter (const QgsExpression &exp, QDomDocument &doc, QString *errorMessage=0)
 Creates OGC filter XML element.

Static Private Member Functions

static QgsGeometrygeometryFromGMLPoint (const QDomElement &geometryElement)
 static method that creates geometry from GML Point
static QgsGeometrygeometryFromGMLLineString (const QDomElement &geometryElement)
 static method that creates geometry from GML LineString
static QgsGeometrygeometryFromGMLPolygon (const QDomElement &geometryElement)
 static method that creates geometry from GML Polygon
static QgsGeometrygeometryFromGMLMultiPoint (const QDomElement &geometryElement)
 static method that creates geometry from GML MultiPoint
static QgsGeometrygeometryFromGMLMultiLineString (const QDomElement &geometryElement)
 static method that creates geometry from GML MultiLineString
static QgsGeometrygeometryFromGMLMultiPolygon (const QDomElement &geometryElement)
 static method that creates geometry from GML MultiPolygon
static bool readGMLCoordinates (QgsPolyline &coords, const QDomElement &elem)
 Reads the.
static bool readGMLPositions (QgsPolyline &coords, const QDomElement &elem)
 Reads the.
static QDomElement createGMLCoordinates (const QgsPolyline &points, QDomDocument &doc)
 Create a GML coordinates element from a point list.
static QDomElement createGMLPositions (const QgsPolyline &points, QDomDocument &doc)
 Create a GML pos or posList element from a point list.
static QgsExpression::NodenodeFromOgcFilter (QDomElement &element, QString &errorMessage)
 handle a generic sub-expression
static
QgsExpression::NodeBinaryOperator
nodeBinaryOperatorFromOgcFilter (QDomElement &element, QString &errorMessage)
 handle a generic binary operator
static
QgsExpression::NodeFunction
nodeSpatialOperatorFromOgcFilter (QDomElement &element, QString &errorMessage)
 handles various spatial operation tags (
static
QgsExpression::NodeUnaryOperator
nodeNotFromOgcFilter (QDomElement &element, QString &errorMessage)
 handle
static
QgsExpression::NodeFunction
nodeFunctionFromOgcFilter (QDomElement &element, QString &errorMessage)
 handles
static QgsExpression::NodenodeLiteralFromOgcFilter (QDomElement &element, QString &errorMessage)
 handles
static
QgsExpression::NodeColumnRef
nodeColumnRefFromOgcFilter (QDomElement &element, QString &errorMessage)
 handles
static QgsExpression::NodenodeIsBetweenFromOgcFilter (QDomElement &element, QString &errorMessage)
 handles
static
QgsExpression::NodeBinaryOperator
nodePropertyIsNullFromOgcFilter (QDomElement &element, QString &errorMessage)
 handles
static QDomElement expressionNodeToOgcFilter (const QgsExpression::Node *node, QDomDocument &doc, QString &errorMessage)
static QDomElement expressionUnaryOperatorToOgcFilter (const QgsExpression::NodeUnaryOperator *node, QDomDocument &doc, QString &errorMessage)
static QDomElement expressionBinaryOperatorToOgcFilter (const QgsExpression::NodeBinaryOperator *node, QDomDocument &doc, QString &errorMessage)
static QDomElement expressionLiteralToOgcFilter (const QgsExpression::NodeLiteral *node, QDomDocument &doc, QString &errorMessage)
static QDomElement expressionColumnRefToOgcFilter (const QgsExpression::NodeColumnRef *node, QDomDocument &doc, QString &errorMessage)
static QDomElement expressionInOperatorToOgcFilter (const QgsExpression::NodeInOperator *node, QDomDocument &doc, QString &errorMessage)
static QDomElement expressionFunctionToOgcFilter (const QgsExpression::NodeFunction *node, QDomDocument &doc, QString &errorMessage)

Detailed Description

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

Currently supported standards:

Note
added in 2.0

Definition at line 30 of file qgsogcutils.h.

Member Function Documentation

QColor QgsOgcUtils::colorFromOgcFill ( const QDomElement &  fillElement)
static

Parse XML with OGC fill into QColor.

Definition at line 1400 of file qgsogcutils.cpp.

Referenced by QgsVectorLayer::readSldLabeling().

QDomElement QgsOgcUtils::createGMLCoordinates ( const QgsPolyline points,
QDomDocument &  doc 
)
staticprivate

Create a GML coordinates element from a point list.

Parameters
pointslist of data points
docthe GML document
Returns
QDomElement

Definition at line 1347 of file qgsogcutils.cpp.

References qgsDoubleToString().

QDomElement QgsOgcUtils::createGMLPositions ( const QgsPolyline points,
QDomDocument &  doc 
)
staticprivate

Create a GML pos or posList element from a point list.

Parameters
pointslist of data points
docthe GML document
Returns
QDomElement

Definition at line 1371 of file qgsogcutils.cpp.

References qgsDoubleToString().

QDomElement QgsOgcUtils::expressionBinaryOperatorToOgcFilter ( const QgsExpression::NodeBinaryOperator node,
QDomDocument &  doc,
QString &  errorMessage 
)
staticprivate
QDomElement QgsOgcUtils::expressionColumnRefToOgcFilter ( const QgsExpression::NodeColumnRef node,
QDomDocument &  doc,
QString &  errorMessage 
)
staticprivate

Definition at line 2035 of file qgsogcutils.cpp.

References QgsExpression::NodeColumnRef::name().

Referenced by expressionNodeToOgcFilter().

QgsExpression * QgsOgcUtils::expressionFromOgcFilter ( const QDomElement &  element)
static
QDomElement QgsOgcUtils::expressionFunctionToOgcFilter ( const QgsExpression::NodeFunction node,
QDomDocument &  doc,
QString &  errorMessage 
)
staticprivate
QDomElement QgsOgcUtils::expressionInOperatorToOgcFilter ( const QgsExpression::NodeInOperator node,
QDomDocument &  doc,
QString &  errorMessage 
)
staticprivate
QDomElement QgsOgcUtils::expressionLiteralToOgcFilter ( const QgsExpression::NodeLiteral node,
QDomDocument &  doc,
QString &  errorMessage 
)
staticprivate

Definition at line 2009 of file qgsogcutils.cpp.

References QgsExpression::NodeLiteral::value().

Referenced by expressionNodeToOgcFilter().

QDomElement QgsOgcUtils::expressionNodeToOgcFilter ( const QgsExpression::Node node,
QDomDocument &  doc,
QString &  errorMessage 
)
staticprivate
QDomElement QgsOgcUtils::expressionToOgcFilter ( const QgsExpression exp,
QDomDocument &  doc,
QString *  errorMessage = 0 
)
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 1870 of file qgsogcutils.cpp.

References expressionNodeToOgcFilter(), OGC_NAMESPACE, and QgsExpression::rootNode().

Referenced by QgsSymbolLayerV2Utils::createFunctionElement().

QDomElement QgsOgcUtils::expressionUnaryOperatorToOgcFilter ( const QgsExpression::NodeUnaryOperator node,
QDomDocument &  doc,
QString &  errorMessage 
)
staticprivate
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 81 of file qgsogcutils.cpp.

References GML_NAMESPACE.

Referenced by fcnGeomFromGML().

QgsGeometry * QgsOgcUtils::geometryFromGML ( const QDomNode &  geometryNode)
static
QgsGeometry * QgsOgcUtils::geometryFromGMLLineString ( const QDomElement &  geometryElement)
staticprivate

static method that creates geometry from GML LineString

Definition at line 148 of file qgsogcutils.cpp.

References QgsGeometry::fromWkb(), GML_NAMESPACE, readGMLCoordinates(), readGMLPositions(), size, and QGis::WKBLineString.

Referenced by geometryFromGML().

QgsGeometry * QgsOgcUtils::geometryFromGMLMultiLineString ( const QDomElement &  geometryElement)
staticprivate

static method that creates geometry from GML MultiLineString

Definition at line 434 of file qgsogcutils.cpp.

References QgsGeometry::fromWkb(), GML_NAMESPACE, readGMLCoordinates(), readGMLPositions(), size, QGis::WKBLineString, and QGis::WKBMultiLineString.

Referenced by geometryFromGML().

QgsGeometry * QgsOgcUtils::geometryFromGMLMultiPoint ( const QDomElement &  geometryElement)
staticprivate

static method that creates geometry from GML MultiPoint

Definition at line 336 of file qgsogcutils.cpp.

References QgsGeometry::fromWkb(), GML_NAMESPACE, readGMLCoordinates(), readGMLPositions(), size, QGis::WKBMultiPoint, and QGis::WKBPoint.

Referenced by geometryFromGML().

QgsGeometry * QgsOgcUtils::geometryFromGMLMultiPolygon ( const QDomElement &  geometryElement)
staticprivate

static method that creates geometry from GML MultiPolygon

Definition at line 580 of file qgsogcutils.cpp.

References QgsGeometry::fromWkb(), GML_NAMESPACE, readGMLCoordinates(), readGMLPositions(), size, QGis::WKBMultiPolygon, and QGis::WKBPolygon.

Referenced by geometryFromGML().

QgsGeometry * QgsOgcUtils::geometryFromGMLPoint ( const QDomElement &  geometryElement)
staticprivate

static method that creates geometry from GML Point

Definition at line 93 of file qgsogcutils.cpp.

References QgsGeometry::fromWkb(), GML_NAMESPACE, readGMLCoordinates(), readGMLPositions(), size, and QGis::WKBPoint.

Referenced by geometryFromGML().

QgsGeometry * QgsOgcUtils::geometryFromGMLPolygon ( const QDomElement &  geometryElement)
staticprivate

static method that creates geometry from GML Polygon

Definition at line 209 of file qgsogcutils.cpp.

References QgsGeometry::fromWkb(), GML_NAMESPACE, readGMLCoordinates(), readGMLPositions(), size, and QGis::WKBPolygon.

Referenced by geometryFromGML().

QDomElement QgsOgcUtils::geometryToGML ( QgsGeometry geometry,
QDomDocument &  doc,
QString  format 
)
static
QDomElement QgsOgcUtils::geometryToGML ( QgsGeometry geometry,
QDomDocument &  doc 
)
static

Exports the geometry to GML2.

Returns
QDomElement

Definition at line 1342 of file qgsogcutils.cpp.

References geometryToGML().

QgsExpression::NodeBinaryOperator * QgsOgcUtils::nodeBinaryOperatorFromOgcFilter ( QDomElement &  element,
QString &  errorMessage 
)
staticprivate

handle a generic binary operator

Definition at line 1584 of file qgsogcutils.cpp.

References binaryOperatorFromTagName(), and nodeFromOgcFilter().

Referenced by nodeFromOgcFilter().

QgsExpression::NodeColumnRef * QgsOgcUtils::nodeColumnRefFromOgcFilter ( QDomElement &  element,
QString &  errorMessage 
)
staticprivate

handles

<PropertyName> 

tag

Definition at line 1779 of file qgsogcutils.cpp.

Referenced by nodeFromOgcFilter().

QgsExpression::Node * QgsOgcUtils::nodeFromOgcFilter ( QDomElement &  element,
QString &  errorMessage 
)
staticprivate
QgsExpression::NodeFunction * QgsOgcUtils::nodeFunctionFromOgcFilter ( QDomElement &  element,
QString &  errorMessage 
)
staticprivate
QgsExpression::Node * QgsOgcUtils::nodeIsBetweenFromOgcFilter ( QDomElement &  element,
QString &  errorMessage 
)
staticprivate

handles

<PropertyIsBetween> 

tag

Definition at line 1791 of file qgsogcutils.cpp.

References QgsExpression::boAnd, QgsExpression::boGE, QgsExpression::boLE, and nodeFromOgcFilter().

Referenced by nodeFromOgcFilter().

QgsExpression::Node * QgsOgcUtils::nodeLiteralFromOgcFilter ( QDomElement &  element,
QString &  errorMessage 
)
staticprivate

handles

<Literal> 

tag

Definition at line 1712 of file qgsogcutils.cpp.

References QgsExpression::boConcat, and nodeFromOgcFilter().

Referenced by nodeFromOgcFilter().

QgsExpression::NodeUnaryOperator * QgsOgcUtils::nodeNotFromOgcFilter ( QDomElement &  element,
QString &  errorMessage 
)
staticprivate

handle

<Not> 

tag

Definition at line 1655 of file qgsogcutils.cpp.

References nodeFromOgcFilter(), and QgsExpression::uoNot.

Referenced by nodeFromOgcFilter().

QgsExpression::NodeBinaryOperator * QgsOgcUtils::nodePropertyIsNullFromOgcFilter ( QDomElement &  element,
QString &  errorMessage 
)
staticprivate

handles

<PropertyIsNull> 

tag

Definition at line 1847 of file qgsogcutils.cpp.

References QgsExpression::boIs, and nodeFromOgcFilter().

Referenced by nodeFromOgcFilter().

QgsExpression::NodeFunction * QgsOgcUtils::nodeSpatialOperatorFromOgcFilter ( QDomElement &  element,
QString &  errorMessage 
)
staticprivate

handles various spatial operation tags (

<Intersects> 

,

<Touches> 

etc.)

Definition at line 1620 of file qgsogcutils.cpp.

References QgsExpression::NodeList::append(), and QgsExpression::functionIndex().

Referenced by nodeFromOgcFilter().

bool QgsOgcUtils::readGMLCoordinates ( QgsPolyline coords,
const QDomElement &  elem 
)
staticprivate

Reads the.

<gml:coordinates> 

element and extracts the coordinates as points

Parameters
coordslist where the found coordinates are appended
elemthe
<gml:coordinates> 
element
Returns
boolean for success

Definition at line 785 of file qgsogcutils.cpp.

Referenced by geometryFromGMLLineString(), geometryFromGMLMultiLineString(), geometryFromGMLMultiPoint(), geometryFromGMLMultiPolygon(), geometryFromGMLPoint(), and geometryFromGMLPolygon().

bool QgsOgcUtils::readGMLPositions ( QgsPolyline coords,
const QDomElement &  elem 
)
staticprivate

Reads the.

<gml:pos> 

or

<gml:posList> 

and extracts the coordinates as points

Parameters
coordslist where the found coordinates are appended
elemthe
<gml:pos> 
or
<gml:posList> 
element
Returns
boolean for success

Definition at line 866 of file qgsogcutils.cpp.

Referenced by geometryFromGMLLineString(), geometryFromGMLMultiLineString(), geometryFromGMLMultiPoint(), geometryFromGMLMultiPolygon(), geometryFromGMLPoint(), and geometryFromGMLPolygon().

QgsRectangle QgsOgcUtils::rectangleFromGMLBox ( const QDomNode &  boxNode)
static

read rectangle from GML2 Box

Definition at line 830 of file qgsogcutils.cpp.

References QgsRectangle::normalize().

Referenced by geometryFromGML().

QgsRectangle QgsOgcUtils::rectangleFromGMLEnvelope ( const QDomNode &  envelopeNode)
static

read rectangle from GML3 Envelope

Definition at line 917 of file qgsogcutils.cpp.

References GML_NAMESPACE, and QgsRectangle::normalize().

Referenced by geometryFromGML().

QDomElement QgsOgcUtils::rectangleToGMLBox ( QgsRectangle box,
QDomDocument &  doc 
)
static

Exports the rectangle to GML2 Box.

Returns
QDomElement

Definition at line 996 of file qgsogcutils.cpp.

References qgsDoubleToString(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().

Referenced by expressionFunctionToOgcFilter().

QDomElement QgsOgcUtils::rectangleToGMLEnvelope ( QgsRectangle env,
QDomDocument &  doc 
)
static

Exports the rectangle to GML2 Envelope.

Returns
QDomElement

Definition at line 1024 of file qgsogcutils.cpp.

References qgsDoubleToString(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().


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