31 #include <QDomElement>
32 #include <QStringList>
41 class CORE_EXPORT
QgsGml :
public QObject
46 const QString& typeName,
47 const QString& geometryAttribute,
61 int getFeatures(
const QString& uri,
QGis::WkbType* wkbType,
QgsRectangle* extent = 0,
const QString& userName = QString(),
const QString& password = QString() );
69 QMap<QgsFeatureId, QgsFeature* >
featuresMap()
const {
return mFeatures; }
72 QMap<QgsFeatureId, QString >
idsMap()
const {
return mIdMap; }
83 void handleProgressEvent( qint64 progress, qint64 totalSteps );
86 void dataReadProgress(
int progress );
87 void totalStepsUpdate(
int totalSteps );
89 void dataProgressAndSteps(
int progress,
int totalSteps );
108 void startElement(
const XML_Char* el,
const XML_Char** attr );
109 void endElement(
const XML_Char* el );
110 void characters(
const XML_Char* chars,
int len );
111 static void start(
void* data,
const XML_Char* el,
const XML_Char** attr )
113 static_cast<QgsGml*
>( data )->startElement( el, attr );
115 static void end(
void* data,
const XML_Char* el )
117 static_cast<QgsGml*
>( data )->endElement( el );
119 static void chars(
void* data,
const XML_Char* chars,
int len )
121 static_cast<QgsGml*
>( data )->characters( chars, len );
125 void setAttribute(
const QString& name,
const QString& value );
134 int readEpsgFromAttribute(
int& epsgNr,
const XML_Char** attr )
const;
140 QString readAttribute(
const QString& attributeName,
const XML_Char** attr )
const;
143 int createBBoxFromCoordinateString(
QgsRectangle &bb,
const QString& coordString )
const;
149 int pointsFromCoordinateString( QList<QgsPoint>& points,
const QString& coordString )
const;
157 int pointsFromPosListString( QList<QgsPoint>& points,
const QString& coordString,
int dimension )
const;
159 int pointsFromString( QList<QgsPoint>& points,
const QString& coordString )
const;
160 int getPointWKB(
unsigned char** wkb,
int*
size,
const QgsPoint& )
const;
161 int getLineWKB(
unsigned char** wkb,
int*
size,
const QList<QgsPoint>& lineCoordinates )
const;
162 int getRingWKB(
unsigned char** wkb,
int*
size,
const QList<QgsPoint>& ringCoordinates )
const;
168 int createMultiLineFromFragments();
169 int createMultiPointFromFragments();
170 int createPolygonFromFragments();
171 int createMultiPolygonFromFragments();
173 int totalWKBFragmentSize()
const;
176 QWidget* findMainWindow()
const;
182 void calculateExtentFromFeatures();
185 ParseMode modeStackTop() {
return mParseModeStack.isEmpty() ? none : mParseModeStack.top(); }
188 ParseMode modeStackPop() {
return mParseModeStack.isEmpty() ? none : mParseModeStack.pop(); }
197 QMap<QgsFeatureId, QgsFeature* > mFeatures;
202 QMap<QgsFeatureId, QString > mIdMap;
205 QString mGeometryAttribute;
207 QMap<QString, QPair<int, QgsField> > mThematicAttributes;
212 QStack<ParseMode> mParseModeStack;
216 QVector<QVariant> mCurrentAttributes;
217 QString mCurrentFeatureId;
220 unsigned char* mCurrentWKB;
228 QList< QList<unsigned char*> > mCurrentWKBFragments;
230 QList< QList<int> > mCurrentWKBFragmentSizes;
231 QString mAttributeName;
234 QString mCoordinateSeparator;
236 QString mTupleSeparator;