QGIS API Documentation
2.2.0-Valmiera
|
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 QgsGeometry * | geometryFromGML (const QString &xmlString) |
static method that creates geometry from GML | |
static QgsGeometry * | geometryFromGML (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 QgsExpression * | expressionFromOgcFilter (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 QgsGeometry * | geometryFromGMLPoint (const QDomElement &geometryElement) |
static method that creates geometry from GML Point | |
static QgsGeometry * | geometryFromGMLLineString (const QDomElement &geometryElement) |
static method that creates geometry from GML LineString | |
static QgsGeometry * | geometryFromGMLPolygon (const QDomElement &geometryElement) |
static method that creates geometry from GML Polygon | |
static QgsGeometry * | geometryFromGMLMultiPoint (const QDomElement &geometryElement) |
static method that creates geometry from GML MultiPoint | |
static QgsGeometry * | geometryFromGMLMultiLineString (const QDomElement &geometryElement) |
static method that creates geometry from GML MultiLineString | |
static QgsGeometry * | geometryFromGMLMultiPolygon (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::Node * | nodeFromOgcFilter (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::Node * | nodeLiteralFromOgcFilter (QDomElement &element, QString &errorMessage) |
handles | |
static QgsExpression::NodeColumnRef * | nodeColumnRefFromOgcFilter (QDomElement &element, QString &errorMessage) |
handles | |
static QgsExpression::Node * | nodeIsBetweenFromOgcFilter (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) |
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 30 of file qgsogcutils.h.
|
static |
Parse XML with OGC fill into QColor.
Definition at line 1400 of file qgsogcutils.cpp.
Referenced by QgsVectorLayer::readSldLabeling().
|
staticprivate |
Create a GML coordinates element from a point list.
points | list of data points |
doc | the GML document |
Definition at line 1347 of file qgsogcutils.cpp.
References qgsDoubleToString().
|
staticprivate |
Create a GML pos or posList element from a point list.
points | list of data points |
doc | the GML document |
Definition at line 1371 of file qgsogcutils.cpp.
References qgsDoubleToString().
|
staticprivate |
Definition at line 1940 of file qgsogcutils.cpp.
References QgsExpression::BinaryOperatorText, binaryOperatorToTagName(), QgsExpression::boEQ, QgsExpression::boILike, QgsExpression::boIs, QgsExpression::boIsNot, QgsExpression::boLike, QgsExpression::boNE, expressionNodeToOgcFilter(), QgsExpression::Node::nodeType(), QgsExpression::ntLiteral, QgsExpression::NodeBinaryOperator::op(), QgsExpression::NodeBinaryOperator::opLeft(), QgsExpression::NodeBinaryOperator::opRight(), and QgsExpression::NodeLiteral::value().
Referenced by expressionNodeToOgcFilter().
|
staticprivate |
Definition at line 2035 of file qgsogcutils.cpp.
References QgsExpression::NodeColumnRef::name().
Referenced by expressionNodeToOgcFilter().
|
static |
Parse XML with OGC filter into QGIS expression.
Definition at line 1439 of file qgsogcutils.cpp.
References QgsExpression::boConcat, QgsExpression::dump(), QgsExpression::mExp, QgsExpression::mParserErrorString, QgsExpression::mRootNode, and nodeFromOgcFilter().
Referenced by QgsRuleBasedRendererV2::Rule::createFromSld(), and QgsSymbolLayerV2Utils::functionFromSldElement().
|
staticprivate |
Definition at line 2126 of file qgsogcutils.cpp.
References QgsExpression::NodeFunction::args(), expressionNodeToOgcFilter(), QgsExpression::NodeFunction::fnIndex(), QgsGeometry::fromWkt(), QgsExpression::Functions(), geometryFromConstExpr(), geometryToGML(), isBinarySpatialOperator(), isGeometryColumn(), QgsExpression::NodeList::list(), QgsExpression::Function::name(), QgsExpression::Node::nodeType(), QgsExpression::ntFunction, QgsExpression::ntLiteral, QgsExpression::Function::params(), rectangleToGMLBox(), and tagNameForSpatialOperator().
Referenced by expressionNodeToOgcFilter().
|
staticprivate |
Definition at line 2044 of file qgsogcutils.cpp.
References expressionNodeToOgcFilter(), QgsExpression::NodeList::list(), QgsExpression::NodeInOperator::list(), and QgsExpression::NodeInOperator::node().
Referenced by expressionNodeToOgcFilter().
|
staticprivate |
Definition at line 2009 of file qgsogcutils.cpp.
References QgsExpression::NodeLiteral::value().
Referenced by expressionNodeToOgcFilter().
|
staticprivate |
Definition at line 1889 of file qgsogcutils.cpp.
References expressionBinaryOperatorToOgcFilter(), expressionColumnRefToOgcFilter(), expressionFunctionToOgcFilter(), expressionInOperatorToOgcFilter(), expressionLiteralToOgcFilter(), expressionUnaryOperatorToOgcFilter(), QgsExpression::Node::nodeType(), QgsExpression::ntBinaryOperator, QgsExpression::ntColumnRef, QgsExpression::ntFunction, QgsExpression::ntInOperator, QgsExpression::ntLiteral, and QgsExpression::ntUnaryOperator.
Referenced by expressionBinaryOperatorToOgcFilter(), expressionFunctionToOgcFilter(), expressionInOperatorToOgcFilter(), expressionToOgcFilter(), and expressionUnaryOperatorToOgcFilter().
|
static |
Creates OGC filter XML element.
Supports minimum standard filter according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT)
<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().
|
staticprivate |
Definition at line 1913 of file qgsogcutils.cpp.
References expressionNodeToOgcFilter(), QgsExpression::NodeUnaryOperator::op(), QgsExpression::NodeUnaryOperator::operand(), QgsExpression::UnaryOperatorText, QgsExpression::uoMinus, and QgsExpression::uoNot.
Referenced by expressionNodeToOgcFilter().
|
static |
static method that creates geometry from GML
xmlString | xml 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().
|
static |
static method that creates geometry from GML
Definition at line 20 of file qgsogcutils.cpp.
References QgsGeometry::fromRect(), geometryFromGMLLineString(), geometryFromGMLMultiLineString(), geometryFromGMLMultiPoint(), geometryFromGMLMultiPolygon(), geometryFromGMLPoint(), geometryFromGMLPolygon(), rectangleFromGMLBox(), and rectangleFromGMLEnvelope().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
static |
Exports the geometry to GML2 or GML3.
Definition at line 1053 of file qgsogcutils.cpp.
References QgsGeometry::asWkb(), qgsDoubleToString(), QGis::WKBLineString, QGis::WKBLineString25D, QGis::WKBMultiLineString, QGis::WKBMultiLineString25D, QGis::WKBMultiPoint, QGis::WKBMultiPoint25D, QGis::WKBMultiPolygon, QGis::WKBMultiPolygon25D, QGis::WKBPoint, QGis::WKBPoint25D, QGis::WKBPolygon, QGis::WKBPolygon25D, and QgsGeometry::wkbType().
Referenced by expressionFunctionToOgcFilter(), and geometryToGML().
|
static |
Exports the geometry to GML2.
Definition at line 1342 of file qgsogcutils.cpp.
References geometryToGML().
|
staticprivate |
handle a generic binary operator
Definition at line 1584 of file qgsogcutils.cpp.
References binaryOperatorFromTagName(), and nodeFromOgcFilter().
Referenced by nodeFromOgcFilter().
|
staticprivate |
handles
<PropertyName>
tag
Definition at line 1779 of file qgsogcutils.cpp.
Referenced by nodeFromOgcFilter().
|
staticprivate |
handle a generic sub-expression
Definition at line 1534 of file qgsogcutils.cpp.
References isBinaryOperator(), isSpatialOperator(), nodeBinaryOperatorFromOgcFilter(), nodeColumnRefFromOgcFilter(), nodeFunctionFromOgcFilter(), nodeIsBetweenFromOgcFilter(), nodeLiteralFromOgcFilter(), nodeNotFromOgcFilter(), nodePropertyIsNullFromOgcFilter(), and nodeSpatialOperatorFromOgcFilter().
Referenced by expressionFromOgcFilter(), nodeBinaryOperatorFromOgcFilter(), nodeFunctionFromOgcFilter(), nodeIsBetweenFromOgcFilter(), nodeLiteralFromOgcFilter(), nodeNotFromOgcFilter(), and nodePropertyIsNullFromOgcFilter().
|
staticprivate |
handles
<Function>
tag
Definition at line 1673 of file qgsogcutils.cpp.
References QgsExpression::NodeList::append(), QgsExpression::Functions(), QgsExpression::Function::name(), and nodeFromOgcFilter().
Referenced by nodeFromOgcFilter().
|
staticprivate |
handles
<PropertyIsBetween>
tag
Definition at line 1791 of file qgsogcutils.cpp.
References QgsExpression::boAnd, QgsExpression::boGE, QgsExpression::boLE, and nodeFromOgcFilter().
Referenced by nodeFromOgcFilter().
|
staticprivate |
handles
<Literal>
tag
Definition at line 1712 of file qgsogcutils.cpp.
References QgsExpression::boConcat, and nodeFromOgcFilter().
Referenced by nodeFromOgcFilter().
|
staticprivate |
handle
<Not>
tag
Definition at line 1655 of file qgsogcutils.cpp.
References nodeFromOgcFilter(), and QgsExpression::uoNot.
Referenced by nodeFromOgcFilter().
|
staticprivate |
handles
<PropertyIsNull>
tag
Definition at line 1847 of file qgsogcutils.cpp.
References QgsExpression::boIs, and nodeFromOgcFilter().
Referenced by nodeFromOgcFilter().
|
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().
|
staticprivate |
Reads the.
<gml:coordinates>
element and extracts the coordinates as points
coords | list where the found coordinates are appended |
elem | the <gml:coordinates>element |
Definition at line 785 of file qgsogcutils.cpp.
Referenced by geometryFromGMLLineString(), geometryFromGMLMultiLineString(), geometryFromGMLMultiPoint(), geometryFromGMLMultiPolygon(), geometryFromGMLPoint(), and geometryFromGMLPolygon().
|
staticprivate |
Reads the.
<gml:pos>
or
<gml:posList>
and extracts the coordinates as points
coords | list where the found coordinates are appended |
elem | the <gml:pos>or <gml:posList>element |
Definition at line 866 of file qgsogcutils.cpp.
Referenced by geometryFromGMLLineString(), geometryFromGMLMultiLineString(), geometryFromGMLMultiPoint(), geometryFromGMLMultiPolygon(), geometryFromGMLPoint(), and geometryFromGMLPolygon().
|
static |
read rectangle from GML2 Box
Definition at line 830 of file qgsogcutils.cpp.
References QgsRectangle::normalize().
Referenced by geometryFromGML().
|
static |
read rectangle from GML3 Envelope
Definition at line 917 of file qgsogcutils.cpp.
References GML_NAMESPACE, and QgsRectangle::normalize().
Referenced by geometryFromGML().
|
static |
Exports the rectangle to GML2 Box.
Definition at line 996 of file qgsogcutils.cpp.
References qgsDoubleToString(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by expressionFunctionToOgcFilter().
|
static |
Exports the rectangle to GML2 Envelope.
Definition at line 1024 of file qgsogcutils.cpp.
References qgsDoubleToString(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().