24 #include <QNetworkRequest>
25 #include <QNetworkReply>
26 #include <QProgressDialog>
38 const QString& geometryAttribute,
41 , mTypeName( typeName )
42 , mGeometryAttribute( geometryAttribute )
45 , mCurrentFeature( 0 )
48 , mCurrentWKBSize( 0 )
50 , mCoorMode(
QgsGml::coordinate )
53 mThematicAttributes.
clear();
54 for (
int i = 0; i < fields.
size(); i++ )
56 mThematicAttributes.
insert( fields[i].
name(), qMakePair( i, fields[i] ) );
62 if ( index != -1 && index < mTypeName.
length() )
64 mTypeName = mTypeName.
mid( index + 1 );
78 XML_SetUserData( p,
this );
79 XML_SetElementHandler( p, QgsGml::start, QgsGml::end );
80 XML_SetCharacterDataHandler( p, QgsGml::chars );
88 request.
setRawHeader(
"Authorization",
"Basic " +
QString(
"%1:%2" ).arg( userName ).arg( password ).toAscii().toBase64() );
92 connect( reply, SIGNAL( finished() ),
this, SLOT( setFinished() ) );
93 connect( reply, SIGNAL( downloadProgress( qint64, qint64 ) ),
this, SLOT( handleProgressEvent( qint64, qint64 ) ) );
98 QWidgetList topLevelWidgets = qApp->topLevelWidgets();
99 for ( QWidgetList::iterator it = topLevelWidgets.begin(); it != topLevelWidgets.end(); ++it )
101 if (( *it )->objectName() ==
"QgisApp" )
109 progressDialog =
new QProgressDialog(
tr(
"Loading GML data\n%1" ).arg( mTypeName ),
tr(
"Abort" ), 0, 0, mainWindow );
113 connect( progressDialog, SIGNAL( canceled() ),
this, SLOT( setFinished() ) );
114 progressDialog->
show();
125 if ( readData.
size() > 0 )
127 if ( XML_Parse( p, readData.
constData(), readData.
size(), atEnd ) == 0 )
129 XML_Error errorCode = XML_GetErrorCode( p );
130 QString errorString =
tr(
"Error: %1 on line %2, column %3" )
131 .
arg( XML_ErrorString( errorCode ) )
132 .
arg( XML_GetCurrentLineNumber( p ) )
133 .
arg( XML_GetCurrentColumnNumber( p ) );
140 QNetworkReply::NetworkError replyError = reply->
error();
144 delete progressDialog;
149 tr(
"GML Getfeature network request failed with error: %1" ).arg( replyErrorString ),
161 calculateExtentFromFeatures();
178 XML_Parser p = XML_ParserCreateNS( NULL,
NS_SEPARATOR );
179 XML_SetUserData( p,
this );
180 XML_SetElementHandler( p, QgsGml::start, QgsGml::end );
181 XML_SetCharacterDataHandler( p, QgsGml::chars );
191 void QgsGml::setFinished()
196 void QgsGml::handleProgressEvent( qint64 progress, qint64 totalSteps )
198 if ( totalSteps < 0 )
208 void QgsGml::startElement(
const XML_Char* el,
const XML_Char** attr )
211 ParseMode theParseMode( mParseModeStack.isEmpty() ? none : mParseModeStack.
top() );
213 QString localName = splitName.last();
214 QString ns = splitName.
size() > 1 ? splitName.first() :
"";
216 if ( elementName == GML_NAMESPACE +
NS_SEPARATOR +
"coordinates" )
218 mParseModeStack.
push( QgsGml::coordinate );
219 mCoorMode = QgsGml::coordinate;
221 mCoordinateSeparator = readAttribute(
"cs", attr );
222 if ( mCoordinateSeparator.
isEmpty() )
224 mCoordinateSeparator =
",";
226 mTupleSeparator = readAttribute(
"ts", attr );
227 if ( mTupleSeparator.
isEmpty() )
229 mTupleSeparator =
" ";
232 if ( elementName == GML_NAMESPACE +
NS_SEPARATOR +
"pos"
233 || elementName == GML_NAMESPACE +
NS_SEPARATOR +
"posList" )
235 mParseModeStack.
push( QgsGml::posList );
236 mCoorMode = QgsGml::posList;
238 QString dimension = readAttribute(
"srsDimension", attr );
240 mDimension = dimension.
toInt( &ok );
241 if ( dimension.
isEmpty() || !ok )
246 else if ( localName == mGeometryAttribute )
248 mParseModeStack.
push( QgsGml::geometry );
251 else if ( elementName == GML_NAMESPACE +
NS_SEPARATOR +
"boundedBy" )
253 mParseModeStack.
push( QgsGml::boundingBox );
255 else if ( theParseMode == none && localName == mTypeName )
257 Q_ASSERT( !mCurrentFeature );
258 mCurrentFeature =
new QgsFeature( mFeatureCount );
261 mParseModeStack.
push( QgsGml::feature );
262 mCurrentFeatureId = readAttribute(
"fid", attr );
265 else if ( theParseMode == boundingBox && elementName == GML_NAMESPACE +
NS_SEPARATOR +
"Box" )
269 if ( readEpsgFromAttribute( epsgNr, attr ) != 0 )
274 else if ( elementName == GML_NAMESPACE +
NS_SEPARATOR +
"Polygon" )
279 else if ( elementName == GML_NAMESPACE +
NS_SEPARATOR +
"MultiPoint" )
281 mParseModeStack.
push( QgsGml::multiPoint );
286 else if ( elementName == GML_NAMESPACE +
NS_SEPARATOR +
"MultiLineString" )
288 mParseModeStack.
push( QgsGml::multiLine );
293 else if ( elementName == GML_NAMESPACE +
NS_SEPARATOR +
"MultiPolygon" )
295 mParseModeStack.
push( QgsGml::multiPolygon );
297 else if ( theParseMode == feature && mThematicAttributes.
contains( localName ) )
299 mParseModeStack.
push( QgsGml::attribute );
300 mAttributeName = localName;
305 else if ( theParseMode == feature
306 && localName.
compare(
"attribute", Qt::CaseInsensitive ) == 0 )
309 if ( mThematicAttributes.
contains( name ) )
311 QString value = readAttribute(
"value", attr );
312 setAttribute( name, value );
316 if ( mEpsg == 0 && ( localName ==
"Point" || localName ==
"MultiPoint" ||
317 localName ==
"LineString" || localName ==
"MultiLineString" ||
318 localName ==
"Polygon" || localName ==
"MultiPolygon" ) )
320 if ( readEpsgFromAttribute( mEpsg, attr ) != 0 )
331 void QgsGml::endElement(
const XML_Char* el )
334 ParseMode theParseMode( mParseModeStack.isEmpty() ? none : mParseModeStack.
top() );
336 QString localName = splitName.last();
337 QString ns = splitName.
size() > 1 ? splitName.first() :
"";
339 if (( theParseMode == coordinate && elementName == GML_NAMESPACE +
NS_SEPARATOR +
"coordinates" )
340 || ( theParseMode == posList && (
342 || elementName == GML_NAMESPACE +
NS_SEPARATOR +
"posList" ) ) )
344 mParseModeStack.
pop();
346 else if ( theParseMode == attribute && localName == mAttributeName )
348 mParseModeStack.
pop();
350 setAttribute( mAttributeName, mStringCash );
352 else if ( theParseMode == geometry && localName == mGeometryAttribute )
354 mParseModeStack.
pop();
356 else if ( theParseMode == boundingBox && elementName == GML_NAMESPACE +
NS_SEPARATOR +
"boundedBy" )
359 if ( createBBoxFromCoordinateString( mCurrentExtent, mStringCash ) != 0 )
364 mParseModeStack.
pop();
366 else if ( theParseMode == feature && localName == mTypeName )
368 Q_ASSERT( mCurrentFeature );
369 if ( mCurrentWKBSize > 0 )
374 else if ( !mCurrentExtent.
isEmpty() )
384 mFeatures.
insert( mCurrentFeature->
id(), mCurrentFeature );
385 if ( !mCurrentFeatureId.
isEmpty() )
387 mIdMap.
insert( mCurrentFeature->
id(), mCurrentFeatureId );
391 mParseModeStack.
pop();
393 else if ( elementName == GML_NAMESPACE +
NS_SEPARATOR +
"Point" )
396 if ( pointsFromString( pointList, mStringCash ) != 0 )
401 if ( pointList.
count() == 0 )
404 if ( theParseMode == QgsGml::geometry )
407 if ( getPointWKB( &mCurrentWKB, &mCurrentWKBSize, *( pointList.
begin() ) ) != 0 )
419 unsigned char* wkb = 0;
423 if ( getPointWKB( &wkb, &wkbSize, *( pointList.
begin() ) ) != 0 )
427 if ( !mCurrentWKBFragments.
isEmpty() )
429 mCurrentWKBFragments.
last().push_back( wkb );
430 mCurrentWKBFragmentSizes.
last().push_back( wkbSize );
439 else if ( elementName == GML_NAMESPACE +
NS_SEPARATOR +
"LineString" )
444 if ( pointsFromString( pointList, mStringCash ) != 0 )
448 if ( theParseMode == QgsGml::geometry )
450 if ( getLineWKB( &mCurrentWKB, &mCurrentWKBSize, pointList ) != 0 )
462 unsigned char* wkb = 0;
466 if ( getLineWKB( &wkb, &wkbSize, pointList ) != 0 )
470 if ( !mCurrentWKBFragments.
isEmpty() )
472 mCurrentWKBFragments.
last().push_back( wkb );
473 mCurrentWKBFragmentSizes.
last().push_back( wkbSize );
482 else if (( theParseMode == geometry || theParseMode == multiPolygon ) && elementName == GML_NAMESPACE +
NS_SEPARATOR +
"LinearRing" )
485 if ( pointsFromString( pointList, mStringCash ) != 0 )
489 unsigned char* wkb = 0;
491 if ( getRingWKB( &wkb, &wkbSize, pointList ) != 0 )
495 if ( !mCurrentWKBFragments.
isEmpty() )
497 mCurrentWKBFragments.
last().push_back( wkb );
498 mCurrentWKBFragmentSizes.
last().push_back( wkbSize );
506 else if (( theParseMode == geometry || theParseMode == multiPolygon ) && elementName == GML_NAMESPACE +
NS_SEPARATOR +
"Polygon" )
513 if ( theParseMode == geometry )
515 createPolygonFromFragments();
518 else if ( theParseMode == multiPoint && elementName == GML_NAMESPACE +
NS_SEPARATOR +
"MultiPoint" )
521 mParseModeStack.
pop();
522 createMultiPointFromFragments();
524 else if ( theParseMode == multiLine && elementName == GML_NAMESPACE +
NS_SEPARATOR +
"MultiLineString" )
527 mParseModeStack.
pop();
528 createMultiLineFromFragments();
530 else if ( theParseMode == multiPolygon && elementName == GML_NAMESPACE +
NS_SEPARATOR +
"MultiPolygon" )
533 mParseModeStack.
pop();
534 createMultiPolygonFromFragments();
538 void QgsGml::characters(
const XML_Char* chars,
int len )
541 if ( mParseModeStack.size() == 0 )
546 QgsGml::ParseMode theParseMode = mParseModeStack.
top();
547 if ( theParseMode == QgsGml::attribute || theParseMode == QgsGml::coordinate || theParseMode == QgsGml::posList )
553 void QgsGml::setAttribute(
const QString& name,
const QString& value )
557 if ( att_it != mThematicAttributes.
constEnd() )
560 switch ( att_it.
value().second.type() )
562 case QVariant::Double:
568 case QVariant::LongLong:
575 Q_ASSERT( mCurrentFeature );
580 int QgsGml::readEpsgFromAttribute(
int& epsgNr,
const XML_Char** attr )
const
583 while ( attr[i] != NULL )
585 if ( strcmp( attr[i],
"srsName" ) == 0 )
587 QString epsgString( attr[i+1] );
589 if ( epsgString.startsWith(
"http" ) )
591 epsgNrString = epsgString.
section(
"#", 1, 1 );
595 epsgNrString = epsgString.
section(
":", 1, 1 );
598 int eNr = epsgNrString.
toInt( &conversionOk );
611 QString QgsGml::readAttribute(
const QString& attributeName,
const XML_Char** attr )
const
614 while ( attr[i] != NULL )
616 if ( attributeName.
compare( attr[i] ) == 0 )
625 int QgsGml::createBBoxFromCoordinateString(
QgsRectangle &r,
const QString& coordString )
const
628 if ( pointsFromCoordinateString( points, coordString ) != 0 )
633 if ( points.
size() < 2 )
638 r.
set( points[0], points[1] );
646 QStringList tuples = coordString.
split( mTupleSeparator, QString::SkipEmptyParts );
649 bool conversionSuccess;
652 for ( tupleIterator = tuples.
constBegin(); tupleIterator != tuples.
constEnd(); ++tupleIterator )
654 tuples_coordinates = tupleIterator->split( mCoordinateSeparator, QString::SkipEmptyParts );
655 if ( tuples_coordinates.
size() < 2 )
659 x = tuples_coordinates.
at( 0 ).toDouble( &conversionSuccess );
660 if ( !conversionSuccess )
664 y = tuples_coordinates.
at( 1 ).toDouble( &conversionSuccess );
665 if ( !conversionSuccess )
674 int QgsGml::pointsFromPosListString(
QList<QgsPoint>& points,
const QString& coordString,
int dimension )
const
677 QStringList coordinates = coordString.
split(
" ", QString::SkipEmptyParts );
679 if ( coordinates.
size() % dimension != 0 )
684 int ncoor = coordinates.
size() / dimension;
685 for (
int i = 0; i < ncoor; i++ )
687 bool conversionSuccess;
688 double x = coordinates.
value( i * dimension ).toDouble( &conversionSuccess );
689 if ( !conversionSuccess )
693 double y = coordinates.
value( i * dimension + 1 ).toDouble( &conversionSuccess );
694 if ( !conversionSuccess )
705 if ( mCoorMode == QgsGml::coordinate )
707 return pointsFromCoordinateString( points, coordString );
709 else if ( mCoorMode == QgsGml::posList )
711 return pointsFromPosListString( points, coordString, mDimension );
716 int QgsGml::getPointWKB(
unsigned char** wkb,
int* size,
const QgsPoint& point )
const
718 int wkbSize = 1 +
sizeof( int ) + 2 *
sizeof(
double );
720 *wkb =
new unsigned char[wkbSize];
722 double x = point.
x();
723 double y = point.
y();
726 memcpy( &( *wkb )[wkbPosition], &mEndian, 1 );
728 memcpy( &( *wkb )[wkbPosition], &type,
sizeof(
int ) );
729 wkbPosition +=
sizeof( int );
730 memcpy( &( *wkb )[wkbPosition], &x,
sizeof(
double ) );
731 wkbPosition +=
sizeof( double );
732 memcpy( &( *wkb )[wkbPosition], &y,
sizeof(
double ) );
736 int QgsGml::getLineWKB(
unsigned char** wkb,
int* size,
const QList<QgsPoint>& lineCoordinates )
const
738 int wkbSize = 1 + 2 *
sizeof( int ) + lineCoordinates.
size() * 2 *
sizeof( double );
740 *wkb =
new unsigned char[wkbSize];
744 int nPoints = lineCoordinates.
size();
747 memcpy( &( *wkb )[wkbPosition], &mEndian, 1 );
749 memcpy( &( *wkb )[wkbPosition], &type,
sizeof(
int ) );
750 wkbPosition +=
sizeof( int );
751 memcpy( &( *wkb )[wkbPosition], &nPoints,
sizeof(
int ) );
752 wkbPosition +=
sizeof( int );
755 for ( iter = lineCoordinates.
begin(); iter != lineCoordinates.
end(); ++iter )
759 memcpy( &( *wkb )[wkbPosition], &x,
sizeof(
double ) );
760 wkbPosition +=
sizeof( double );
761 memcpy( &( *wkb )[wkbPosition], &y,
sizeof(
double ) );
762 wkbPosition +=
sizeof( double );
767 int QgsGml::getRingWKB(
unsigned char** wkb,
int* size,
const QList<QgsPoint>& ringCoordinates )
const
769 int wkbSize =
sizeof( int ) + ringCoordinates.
size() * 2 *
sizeof( double );
771 *wkb =
new unsigned char[wkbSize];
774 int nPoints = ringCoordinates.
size();
775 memcpy( &( *wkb )[wkbPosition], &nPoints,
sizeof(
int ) );
776 wkbPosition +=
sizeof( int );
779 for ( iter = ringCoordinates.
begin(); iter != ringCoordinates.
end(); ++iter )
783 memcpy( &( *wkb )[wkbPosition], &x,
sizeof(
double ) );
784 wkbPosition +=
sizeof( double );
785 memcpy( &( *wkb )[wkbPosition], &y,
sizeof(
double ) );
786 wkbPosition +=
sizeof( double );
791 int QgsGml::createMultiLineFromFragments()
794 mCurrentWKBSize += 1 + 2 *
sizeof( int );
795 mCurrentWKBSize += totalWKBFragmentSize();
797 mCurrentWKB =
new unsigned char[mCurrentWKBSize];
800 int numLines = mCurrentWKBFragments.
begin()->size();
802 memcpy( &( mCurrentWKB[pos] ), &mEndian, 1 );
804 memcpy( &( mCurrentWKB[pos] ), &type,
sizeof(
int ) );
805 pos +=
sizeof( int );
806 memcpy( &( mCurrentWKB[pos] ), &numLines,
sizeof(
int ) );
807 pos +=
sizeof( int );
812 for ( ; wkbIt != mCurrentWKBFragments.
begin()->end(); ++wkbIt, ++sizeIt )
814 memcpy( &( mCurrentWKB[pos] ), *wkbIt, *sizeIt );
819 mCurrentWKBFragments.
clear();
820 mCurrentWKBFragmentSizes.
clear();
825 int QgsGml::createMultiPointFromFragments()
828 mCurrentWKBSize += 1 + 2 *
sizeof( int );
829 mCurrentWKBSize += totalWKBFragmentSize();
830 mCurrentWKB =
new unsigned char[mCurrentWKBSize];
834 int numPoints = mCurrentWKBFragments.
begin()->size();
836 memcpy( &( mCurrentWKB[pos] ), &mEndian, 1 );
838 memcpy( &( mCurrentWKB[pos] ), &type,
sizeof(
int ) );
839 pos +=
sizeof( int );
840 memcpy( &( mCurrentWKB[pos] ), &numPoints,
sizeof(
int ) );
841 pos +=
sizeof( int );
846 for ( ; wkbIt != mCurrentWKBFragments.
begin()->end(); ++wkbIt, ++sizeIt )
848 memcpy( &( mCurrentWKB[pos] ), *wkbIt, *sizeIt );
853 mCurrentWKBFragments.
clear();
854 mCurrentWKBFragmentSizes.
clear();
860 int QgsGml::createPolygonFromFragments()
863 mCurrentWKBSize += 1 + 2 *
sizeof( int );
864 mCurrentWKBSize += totalWKBFragmentSize();
866 mCurrentWKB =
new unsigned char[mCurrentWKBSize];
869 int numRings = mCurrentWKBFragments.
begin()->size();
870 memcpy( &( mCurrentWKB[pos] ), &mEndian, 1 );
872 memcpy( &( mCurrentWKB[pos] ), &type,
sizeof(
int ) );
873 pos +=
sizeof( int );
874 memcpy( &( mCurrentWKB[pos] ), &numRings,
sizeof(
int ) );
875 pos +=
sizeof( int );
879 for ( ; wkbIt != mCurrentWKBFragments.
begin()->end(); ++wkbIt, ++sizeIt )
881 memcpy( &( mCurrentWKB[pos] ), *wkbIt, *sizeIt );
886 mCurrentWKBFragments.
clear();
887 mCurrentWKBFragmentSizes.
clear();
892 int QgsGml::createMultiPolygonFromFragments()
895 mCurrentWKBSize += 1 + 2 *
sizeof( int );
896 mCurrentWKBSize += totalWKBFragmentSize();
897 mCurrentWKBSize += mCurrentWKBFragments.
size() * ( 1 + 2 *
sizeof( int ) );
899 mCurrentWKB =
new unsigned char[mCurrentWKBSize];
903 int numPolys = mCurrentWKBFragments.
size();
905 memcpy( &( mCurrentWKB[pos] ), &mEndian, 1 );
907 memcpy( &( mCurrentWKB[pos] ), &type,
sizeof(
int ) );
908 pos +=
sizeof( int );
909 memcpy( &( mCurrentWKB[pos] ), &numPolys,
sizeof(
int ) );
910 pos +=
sizeof( int );
918 outerWkbIt = mCurrentWKBFragments.
begin();
919 outerSizeIt = mCurrentWKBFragmentSizes.
begin();
921 for ( ; outerWkbIt != mCurrentWKBFragments.
end(); ++outerWkbIt, ++outerSizeIt )
924 memcpy( &( mCurrentWKB[pos] ), &mEndian, 1 );
926 memcpy( &( mCurrentWKB[pos] ), &polygonType,
sizeof(
int ) );
927 pos +=
sizeof( int );
928 numRings = outerWkbIt->
size();
929 memcpy( &( mCurrentWKB[pos] ), &numRings,
sizeof(
int ) );
930 pos +=
sizeof( int );
932 innerWkbIt = outerWkbIt->
begin();
933 innerSizeIt = outerSizeIt->
begin();
934 for ( ; innerWkbIt != outerWkbIt->
end(); ++innerWkbIt, ++innerSizeIt )
936 memcpy( &( mCurrentWKB[pos] ), *innerWkbIt, *innerSizeIt );
938 delete[] *innerWkbIt;
942 mCurrentWKBFragments.
clear();
943 mCurrentWKBFragmentSizes.
clear();
948 int QgsGml::totalWKBFragmentSize()
const
951 foreach (
const QList<int> &list, mCurrentWKBFragmentSizes )
953 foreach (
int i, list )
961 void QgsGml::calculateExtentFromFeatures()
963 if ( mFeatures.
size() < 1 )
970 bool bboxInitialised =
false;
972 for (
int i = 0; i < mFeatures.
size(); ++i )
974 currentFeature = mFeatures[i];
975 if ( !currentFeature )
980 if ( currentGeometry )
982 if ( !bboxInitialised )
985 bboxInitialised =
true;
QgsFeatureId id() const
Get the feature ID for this feature.
void unionRect(const QgsRectangle &rect)
updates rectangle to include passed argument
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
A rectangle specified with double values.
QString & append(QChar ch)
bool isEmpty() const
test if rectangle is empty.
void setMinimal()
Set a rectangle so that min corner is at max and max corner is at min.
bool contains(const Key &key) const
void push_back(const T &value)
QString errorString() const
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
const T & at(int i) const
QgsRectangle boundingBox() const
Returns the bounding box of this feature.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
void setAttributes(const QgsAttributes &attrs)
Sets the feature's attributes.
bool setAttribute(int field, const QVariant &attr)
Set an attribute's value by field index.
WkbType
Used for symbology operations.
void dataReadProgress(int progress)
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
double toDouble(bool *ok) const
static endian_t endian()
Returns whether this machine uses big or little endian.
QString tr(const char *sourceText, const char *disambiguation, int n)
static void logMessage(QString message, QString tag=QString::null, MessageLevel level=WARNING)
add a message to the instance (and create it if necessary)
void totalStepsUpdate(int totalSteps)
void set(const QgsPoint &p1, const QgsPoint &p2)
Set the rectangle from two QgsPoints.
bool createFromOgcWmsCrs(QString theCrs)
Set up this CRS from the given OGC CRS.
const char * name() const
void setGeometry(const QgsGeometry &geom)
Set this feature's geometry from another QgsGeometry object.
int count(const T &value) const
void processEvents(QFlags< QEventLoop::ProcessEventsFlag > flags)
void append(const T &value)
QString fromUtf8(const char *str, int size)
void dataProgressAndSteps(int progress, int totalSteps)
This class reads data from a WFS server or alternatively from a GML file.
QgsGml(const QString &typeName, const QString &geometryAttribute, const QgsFields &fields)
int toInt(bool *ok, int base) const
const_iterator constEnd() const
const char * constData() const
A class to represent a point.
const QString GML_NAMESPACE
void setValid(bool validity)
Sets the validity of the feature.
QString mid(int position, int n) const
static QgsNetworkAccessManager * instance()
returns a pointer to the single instance
int getFeatures(const QString &uri, QGis::WkbType *wkbType, QgsRectangle *extent=0, const QString &userName=QString(), const QString &password=QString())
Does the Http GET request to the wfs server Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.
Class for storing a coordinate reference system (CRS)
int size() const
Return number of items.
const QgsGeometry * constGeometry() const
Gets a const pointer to the geometry object associated with this feature.
QStringList split(const QString &sep, const QString &str, bool allowEmptyEntries)
static QgsGeometry * fromRect(const QgsRectangle &rect)
Creates a new geometry from a QgsRectangle.
QString section(QChar sep, int start, int end, QFlags< QString::SectionFlag > flags) const
NetworkError error() const
iterator insert(const Key &key, const T &value)
QNetworkReply * get(const QNetworkRequest &request)
const_iterator constEnd() const
const_iterator constBegin() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
int compare(const QString &other) const
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
qlonglong toLongLong(bool *ok, int base) const
iterator find(const Key &key)
QgsCoordinateReferenceSystem crs() const
Returns features spatial reference system.
void setGeometryAndOwnership(unsigned char *geom, size_t length)
Set this feature's geometry from WKB.
const T value(const Key &key) const