QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Classes | Public Types | Public Member Functions | List of all members
QgsGmlStreamingParser Class Reference

This class builds features from GML data in a streaming way. More...

#include <qgsgml.h>

Classes

class  LayerProperties
 Layer properties. More...
 

Public Types

enum  AxisOrientationLogic { Honour_EPSG_if_urn, Honour_EPSG, Ignore_EPSG }
 Axis orientation logic. More...
 
typedef QPair< QgsFeature *, QStringQgsGmlFeaturePtrGmlIdPair
 

Public Member Functions

 QgsGmlStreamingParser (const QString &typeName, const QString &geometryAttribute, const QgsFields &fields, AxisOrientationLogic axisOrientationLogic=Honour_EPSG_if_urn, bool invertAxisOrientation=false)
 Constructor. More...
 
 QgsGmlStreamingParser (const QList< LayerProperties > &layerProperties, const QgsFields &fields, const QMap< QString, QPair< QString, QString > > &mapFieldNameToSrcLayerNameFieldName, AxisOrientationLogic axisOrientationLogic=Honour_EPSG_if_urn, bool invertAxisOrientation=false)
 Constructor for a join layer, or dealing with renamed fields. More...
 
 ~QgsGmlStreamingParser ()
 
const QStringexceptionText () const
 Return the exception text. More...
 
QVector< QgsGmlFeaturePtrGmlIdPairgetAndStealReadyFeatures ()
 Returns the list of features that have been completely parsed. More...
 
int getEPSGCode () const
 Return the EPSG code, or 0 if unknown. More...
 
bool isException () const
 Return whether the document parser is a OGC exception. More...
 
bool isTruncatedResponse () const
 Return whether a "truncatedResponse" element is found. More...
 
const QgsRectanglelayerExtent () const
 Return layer bounding box. More...
 
int numberMatched () const
 Return WFS 2.0 "numberMatched" attribute, or -1 if invalid/not found. More...
 
int numberReturned () const
 Return WFS 2.0 "numberReturned" or WFS 1.1 "numberOfFeatures" attribute, or -1 if invalid/not found. More...
 
bool processData (const QByteArray &data, bool atEnd, QString &errorMsg)
 Process a new chunk of data. More...
 
bool processData (const QByteArray &data, bool atEnd)
 Process a new chunk of data. More...
 
const QStringsrsName () const
 Return the value of the srsName attribute. More...
 
QGis::WkbType wkbType () const
 Return the geometry type. More...
 

Detailed Description

This class builds features from GML data in a streaming way.

The caller must call processData() as soon it has new content from the source. At any point, it can call getAndStealReadyFeatures() to collect the features that have been completely parsed.

Note
not available in Python bindings
Added in QGIS 2.16

Definition at line 47 of file qgsgml.h.

Member Typedef Documentation

◆ QgsGmlFeaturePtrGmlIdPair

Definition at line 51 of file qgsgml.h.

Member Enumeration Documentation

◆ AxisOrientationLogic

Axis orientation logic.

Enumerator
Honour_EPSG_if_urn 

Honour EPSG axis order only if srsName is of the form urn:ogc:def:crs:EPSG:

Honour_EPSG 

Honour EPSG axis order.

Ignore_EPSG 

Ignore EPSG axis order.

Definition at line 69 of file qgsgml.h.

Constructor & Destructor Documentation

◆ QgsGmlStreamingParser() [1/2]

QgsGmlStreamingParser::QgsGmlStreamingParser ( const QString typeName,
const QString geometryAttribute,
const QgsFields fields,
AxisOrientationLogic  axisOrientationLogic = Honour_EPSG_if_urn,
bool  invertAxisOrientation = false 
)

Constructor.

Definition at line 277 of file qgsgml.cpp.

◆ QgsGmlStreamingParser() [2/2]

QgsGmlStreamingParser::QgsGmlStreamingParser ( const QList< LayerProperties > &  layerProperties,
const QgsFields fields,
const QMap< QString, QPair< QString, QString > > &  mapFieldNameToSrcLayerNameFieldName,
AxisOrientationLogic  axisOrientationLogic = Honour_EPSG_if_urn,
bool  invertAxisOrientation = false 
)

Constructor for a join layer, or dealing with renamed fields.

Definition at line 344 of file qgsgml.cpp.

◆ ~QgsGmlStreamingParser()

QgsGmlStreamingParser::~QgsGmlStreamingParser ( )

Definition at line 430 of file qgsgml.cpp.

Member Function Documentation

◆ exceptionText()

const QString& QgsGmlStreamingParser::exceptionText ( ) const
inline

Return the exception text.

Definition at line 130 of file qgsgml.h.

◆ getAndStealReadyFeatures()

QVector< QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair > QgsGmlStreamingParser::getAndStealReadyFeatures ( )

Returns the list of features that have been completely parsed.

This can be called at any point. This will empty the list maintained internally by the parser, so that features already returned will no longer be returned by later calls.

Definition at line 470 of file qgsgml.cpp.

◆ getEPSGCode()

int QgsGmlStreamingParser::getEPSGCode ( ) const
inline

Return the EPSG code, or 0 if unknown.

Definition at line 109 of file qgsgml.h.

◆ isException()

bool QgsGmlStreamingParser::isException ( ) const
inline

Return whether the document parser is a OGC exception.

Definition at line 127 of file qgsgml.h.

◆ isTruncatedResponse()

bool QgsGmlStreamingParser::isTruncatedResponse ( ) const
inline

Return whether a "truncatedResponse" element is found.

Definition at line 133 of file qgsgml.h.

◆ layerExtent()

const QgsRectangle& QgsGmlStreamingParser::layerExtent ( ) const
inline

Return layer bounding box.

Definition at line 115 of file qgsgml.h.

◆ numberMatched()

int QgsGmlStreamingParser::numberMatched ( ) const
inline

Return WFS 2.0 "numberMatched" attribute, or -1 if invalid/not found.

Definition at line 121 of file qgsgml.h.

◆ numberReturned()

int QgsGmlStreamingParser::numberReturned ( ) const
inline

Return WFS 2.0 "numberReturned" or WFS 1.1 "numberOfFeatures" attribute, or -1 if invalid/not found.

Definition at line 124 of file qgsgml.h.

◆ processData() [1/2]

bool QgsGmlStreamingParser::processData ( const QByteArray data,
bool  atEnd,
QString errorMsg 
)

Process a new chunk of data.

atEnd must be set to true when this is the last chunk of data.

Definition at line 454 of file qgsgml.cpp.

◆ processData() [2/2]

bool QgsGmlStreamingParser::processData ( const QByteArray data,
bool  atEnd 
)

Process a new chunk of data.

atEnd must be set to true when this is the last chunk of data.

Definition at line 443 of file qgsgml.cpp.

◆ srsName()

const QString& QgsGmlStreamingParser::srsName ( ) const
inline

Return the value of the srsName attribute.

Definition at line 112 of file qgsgml.h.

◆ wkbType()

QGis::WkbType QgsGmlStreamingParser::wkbType ( ) const
inline

Return the geometry type.

Definition at line 118 of file qgsgml.h.


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