18 #include "qgis_core.h"
28 #include <QDomElement>
29 #include <QStringList>
79 } AxisOrientationLogic;
83 const QString &geometryAttribute,
85 AxisOrientationLogic axisOrientationLogic = Honour_EPSG_if_urn,
86 bool invertAxisOrientation =
false );
91 const QMap< QString, QPair<QString, QString> > &mapFieldNameToSrcLayerNameFieldName,
92 AxisOrientationLogic axisOrientationLogic = Honour_EPSG_if_urn,
93 bool invertAxisOrientation =
false );
105 bool processData(
const QByteArray &data,
bool atEnd, QString &errorMsg );
111 bool processData(
const QByteArray &data,
bool atEnd );
119 QVector<QgsGmlFeaturePtrGmlIdPair> getAndStealReadyFeatures();
174 void startElement(
const XML_Char *el,
const XML_Char **attr );
175 void endElement(
const XML_Char *el );
176 void characters(
const XML_Char *chars,
int len );
177 static void start(
void *data,
const XML_Char *el,
const XML_Char **attr )
181 static void end(
void *data,
const XML_Char *el )
185 static void chars(
void *data,
const XML_Char *chars,
int len )
191 void setAttribute(
const QString &name,
const QString &value );
201 int readEpsgFromAttribute(
int &epsgNr,
const XML_Char **attr );
209 QString readAttribute(
const QString &attributeName,
const XML_Char **attr )
const;
211 bool createBBoxFromCoordinateString(
QgsRectangle &bb,
const QString &coordString )
const;
219 int pointsFromCoordinateString( QList<QgsPointXY> &points,
const QString &coordString )
const;
228 int pointsFromPosListString( QList<QgsPointXY> &points,
const QString &coordString,
int dimension )
const;
230 int pointsFromString( QList<QgsPointXY> &points,
const QString &coordString )
const;
232 int getLineWKB(
QgsWkbPtr &wkbPtr,
const QList<QgsPointXY> &lineCoordinates )
const;
233 int getRingWKB(
QgsWkbPtr &wkbPtr,
const QList<QgsPointXY> &ringCoordinates )
const;
241 int createMultiLineFromFragments();
242 int createMultiPointFromFragments();
243 int createPolygonFromFragments();
244 int createMultiPolygonFromFragments();
246 int totalWKBFragmentSize()
const;
249 ParseMode modeStackTop() {
return mParseModeStack.isEmpty() ? None : mParseModeStack.top(); }
252 ParseMode modeStackPop() {
return mParseModeStack.isEmpty() ? None : mParseModeStack.pop(); }
258 QVector<QgsGmlFeaturePtrGmlIdPair> mFeatureList;
261 QList<LayerProperties> mLayerProperties;
262 QMap< QString, LayerProperties > mMapTypeNameToProperties;
266 QByteArray mTypeNameBA;
267 const char *mTypeNamePtr =
nullptr;
268 size_t mTypeNameUTF8Len;
275 QString mGeometryAttribute;
276 QByteArray mGeometryAttributeBA;
277 const char *mGeometryAttributePtr =
nullptr;
278 size_t mGeometryAttributeUTF8Len;
281 QMap<QString, QPair<int, QgsField> > mThematicAttributes;
284 QString mExceptionText;
285 bool mTruncatedResponse;
288 int mFeatureTupleDepth;
289 QString mCurrentTypename;
290 QStack<ParseMode> mParseModeStack;
295 QVector<QVariant> mCurrentAttributes;
296 QString mCurrentFeatureId;
301 bool mBoundedByNullFound;
309 QList< QList<QgsWkbPtr> > mCurrentWKBFragments;
310 QString mAttributeName;
313 QString mCoordinateSeparator;
315 QString mTupleSeparator;
317 QStack<int> mDimensionStack;
329 QString mGMLNameSpaceURI;
330 const char *mGMLNameSpaceURIPtr =
nullptr;
332 AxisOrientationLogic mAxisOrientationLogic;
334 bool mInvertAxisOrientationRequest;
336 bool mInvertAxisOrientation;
342 std::string mGeometryString;
344 bool mFoundUnhandledGeometryElement;
356 class CORE_EXPORT
QgsGml :
public QObject
362 const QString &geometryAttribute,
377 int getFeatures(
const QString &uri,
380 const QString &userName = QString(),
381 const QString &password = QString(),
382 const QString &authcfg = QString() )
SIP_PYNAME( getFeaturesUri );
391 QMap<QgsFeatureId, QgsFeature * >
featuresMap()
const {
return mFeatures; }
394 QMap<QgsFeatureId, QString >
idsMap()
const {
return mIdMap; }
413 void handleProgressEvent( qint64 progress, qint64 totalSteps );
423 void calculateExtentFromFeatures();
425 void fillMapsFromParser();
437 QMap<QgsFeatureId, QgsFeature * > mFeatures;
442 QMap<QgsFeatureId, QString > mIdMap;