Skip to content

Commit 742c1aa

Browse files
arnaud-morvan3nids
authored andcommittedMay 4, 2017
Sipify core.QgsGml
1 parent 264c902 commit 742c1aa

File tree

3 files changed

+84
-40
lines changed

3 files changed

+84
-40
lines changed
 

‎python/auto_sip.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ core/qgsexpressioncontextgenerator.sip
1212
core/qgsfeaturerequest.sip
1313
core/qgsgeometrysimplifier.sip
1414
core/qgsgeometryvalidator.sip
15-
core/qgsgml.sip
1615
core/qgsgmlschema.sip
1716
core/qgsmaptopixelgeometrysimplifier.sip
1817
core/qgstransaction.sip

‎python/core/qgsgml.sip

Lines changed: 75 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,96 @@
1-
class QgsGml: QObject
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsgml.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
class QgsGml : QObject
215
{
3-
%TypeHeaderCode
4-
#include <qgsgml.h>
16+
%Docstring
17+
This class reads data from a WFS server or alternatively from a GML file. It
18+
uses the expat XML parser and an event based model to keep performance high.
19+
The parsing starts when the first data arrives, it does not wait until the
20+
request is finished *
521
%End
622

23+
%TypeHeaderCode
24+
#include "qgsgml.h"
25+
%End
726
public:
827
QgsGml(
9-
const QString& typeName,
10-
const QString& geometryAttribute,
28+
const QString &typeName,
29+
const QString &geometryAttribute,
1130
const QgsFields &fields );
1231

13-
~QgsGml();
14-
15-
/** Does the Http GET request to the wfs server
16-
* Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.
17-
* @param uri GML URL
18-
* @param wkbType wkbType to retrieve
19-
* @param extent retrieved extents
20-
* @param userName username for authentication
21-
* @param password password for authentication
22-
* @param authcfg authentication configuration id
23-
* @return 0 in case of success
24-
* @note available in python as getFeaturesUri
25-
*/
26-
int getFeatures( const QString& uri,
27-
QgsWkbTypes::Type* wkbType,
28-
QgsRectangle* extent = 0,
29-
const QString& userName = QString(),
30-
const QString& password = QString(),
32+
int getFeatures( const QString &uri,
33+
QgsWkbTypes::Type *wkbType,
34+
QgsRectangle *extent = 0,
35+
const QString &userName = QString(),
36+
const QString &password = QString(),
3137
const QString &authcfg = QString() ) /PyName=getFeaturesUri/;
38+
%Docstring
39+
Does the Http GET request to the wfs server
40+
Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.
41+
\param uri GML URL
42+
\param wkbType wkbType to retrieve
43+
\param extent retrieved extents
44+
\param userName username for authentication
45+
\param password password for authentication
46+
\param authcfg authentication configuration id
47+
:return: 0 in case of success
48+
.. note::
49+
50+
available in Python as getFeaturesUri
51+
:rtype: int
52+
%End
3253

33-
/** Read from GML data. Constructor uri param is ignored
34-
* Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.
35-
*/
3654
int getFeatures( const QByteArray &data, QgsWkbTypes::Type *wkbType, QgsRectangle *extent = 0 );
55+
%Docstring
56+
Read from GML data. Constructor uri param is ignored
57+
Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.
58+
:rtype: int
59+
%End
3760

38-
/** Get parsed features for given type name */
39-
QMap<qint64, QgsFeature* > featuresMap() const;
61+
QMap<QgsFeatureId, QgsFeature * > featuresMap() const;
62+
%Docstring
63+
Get parsed features for given type name
64+
:rtype: QMap<QgsFeatureId, QgsFeature * >
65+
%End
4066

41-
/** Get feature ids map */
42-
QMap<qint64, QString > idsMap() const;
67+
QMap<QgsFeatureId, QString > idsMap() const;
68+
%Docstring
69+
Get feature ids map
70+
:rtype: QMap<QgsFeatureId, str >
71+
%End
4372

44-
/** Returns features spatial reference system
45-
@note Added in QGIS 2.1 */
4673
QgsCoordinateReferenceSystem crs() const;
74+
%Docstring
75+
Returns features spatial reference system
76+
.. versionadded:: 2.1
77+
:rtype: QgsCoordinateReferenceSystem
78+
%End
4779

4880
signals:
4981
void dataReadProgress( int progress );
5082
void totalStepsUpdate( int totalSteps );
51-
//also emit signal with progress and totalSteps together (this is better for the status message)
5283
void dataProgressAndSteps( int progress, int totalSteps );
84+
%Docstring
85+
Also emit signal with progress and totalSteps together (this is better for the status message)
86+
%End
5387

5488
};
89+
90+
/************************************************************************
91+
* This file has been generated automatically from *
92+
* *
93+
* src/core/qgsgml.h *
94+
* *
95+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
96+
************************************************************************/

‎src/core/qgsgml.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
class QgsCoordinateReferenceSystem;
3636

37+
#ifndef SIP_RUN
38+
3739
/** \ingroup core
3840
* This class builds features from GML data in a streaming way. The caller must call processData()
3941
* as soon it has new content from the source. At any point, it can call
@@ -325,6 +327,7 @@ class CORE_EXPORT QgsGmlStreamingParser
325327
bool mFoundUnhandledGeometryElement;
326328
};
327329

330+
#endif
328331

329332
/** \ingroup core
330333
* This class reads data from a WFS server or alternatively from a GML file. It
@@ -373,19 +376,19 @@ class CORE_EXPORT QgsGml : public QObject
373376
\since QGIS 2.1 */
374377
QgsCoordinateReferenceSystem crs() const;
375378

379+
signals:
380+
void dataReadProgress( int progress );
381+
void totalStepsUpdate( int totalSteps );
382+
//! Also emit signal with progress and totalSteps together (this is better for the status message)
383+
void dataProgressAndSteps( int progress, int totalSteps );
384+
376385
private slots:
377386

378387
void setFinished();
379388

380389
//! Takes progress value and total steps and emit signals 'dataReadProgress' and 'totalStepUpdate'
381390
void handleProgressEvent( qint64 progress, qint64 totalSteps );
382391

383-
signals:
384-
void dataReadProgress( int progress );
385-
void totalStepsUpdate( int totalSteps );
386-
//also emit signal with progress and totalSteps together (this is better for the status message)
387-
void dataProgressAndSteps( int progress, int totalSteps );
388-
389392
private:
390393

391394
/** This function evaluates the layer bounding box from the features and

0 commit comments

Comments
 (0)
Please sign in to comment.