1
+ /************************************************************************
2
+ * This file has been generated automatically from *
3
+ * *
4
+ * src/core/qgsvectorlayerimport.h *
5
+ * *
6
+ * Do not edit manually ! Edit header and run scripts/sipify.pl again *
7
+ ************************************************************************/
1
8
2
- /**
3
- There are two possibilities how to use this class:
4
- 1. static call to QgsVectorFileWriter::writeAsShapefile(...) which saves the whole vector layer
5
- 2. create an instance of the class and issue calls to addFeature(...)
6
- */
7
- class QgsVectorLayerImport
9
+
10
+
11
+
12
+
13
+ class QgsVectorLayerImport : QgsFeatureSink
8
14
{
9
- %TypeHeaderCode
10
- #include <qgsvectorlayerimport.h>
11
- #include <qgsfield.h>
12
- class QProgressDialog;
15
+ %Docstring
16
+ A convenience class for writing vector files to disk.
17
+ There are two possibilities how to use this class:
18
+ 1. static call to QgsVectorFileWriter.writeAsShapefile(...) which saves the whole vector layer
19
+ 2. create an instance of the class and issue calls to addFeature(...)
13
20
%End
14
21
22
+ %TypeHeaderCode
23
+ #include "qgsvectorlayerimport.h"
24
+ %End
15
25
public:
16
26
17
27
enum ImportError
@@ -28,77 +38,90 @@ class QProgressDialog;
28
38
ErrInvalidProvider,
29
39
ErrProviderUnsupportedFeature,
30
40
ErrConnectionFailed,
31
- ErrUserCanceled, /*!< User canceled the import*/
41
+ ErrUserCanceled,
32
42
};
33
43
34
- /**
35
- * Writes the contents of vector layer to a different datasource.
36
- * @param layer source layer
37
- * @param uri URI for destination data source
38
- * @param providerKey string key for destination data provider
39
- * @param destCRS destination CRS, or an invalid (default constructed) CRS if
40
- * not available
41
- * @param onlySelected set to true to export only selected features
42
- * @param errorMessage if non-null, will be set to any error messages
43
- * @param skipAttributeCreation set to true to skip exporting feature attributes
44
- * @param options optional provider dataset options
45
- * @param progress optional progress dialog to show progress of export
46
- * @returns NoError for a successful export, or encountered error
47
- */
48
- static ImportError importLayer( QgsVectorLayer* layer,
49
- const QString& uri,
50
- const QString& providerKey,
51
- const QgsCoordinateReferenceSystem& destCRS,
44
+ static ImportError importLayer( QgsVectorLayer *layer,
45
+ const QString &uri,
46
+ const QString &providerKey,
47
+ const QgsCoordinateReferenceSystem &destCRS,
52
48
bool onlySelected = false,
53
49
QString *errorMessage /Out/ = 0,
54
50
bool skipAttributeCreation = false,
55
51
QMap<QString, QVariant> *options = 0,
56
52
QProgressDialog *progress = 0
57
53
);
54
+ %Docstring
55
+ Writes the contents of vector layer to a different datasource.
56
+ \param layer source layer
57
+ \param uri URI for destination data source
58
+ \param providerKey string key for destination data provider
59
+ \param destCRS destination CRS, or an invalid (default constructed) CRS if
60
+ not available
61
+ \param onlySelected set to true to export only selected features
62
+ \param errorMessage if non-null, will be set to any error messages
63
+ \param skipAttributeCreation set to true to skip exporting feature attributes
64
+ \param options optional provider dataset options
65
+ \param progress optional progress dialog to show progress of export
66
+ :return: NoError for a successful export, or encountered error
67
+ :rtype: ImportError
68
+ %End
58
69
59
- /** Constructor for QgsVectorLayerImport.
60
- * @param uri URI for destination data source
61
- * @param provider string key for destination data provider
62
- * @param fields fields to include in created layer
63
- * @param geometryType destination geometry type
64
- * @param crs desired CRS, or an invalid (default constructed) CRS if
65
- * not available
66
- * @param overwrite set to true to overwrite any existing data source
67
- * @param options optional provider dataset options
68
- * @param progress optional progress dialog to show progress of export
69
- */
70
70
QgsVectorLayerImport( const QString &uri,
71
71
const QString &provider,
72
72
const QgsFields &fields,
73
73
QgsWkbTypes::Type geometryType,
74
- const QgsCoordinateReferenceSystem& crs,
74
+ const QgsCoordinateReferenceSystem & crs,
75
75
bool overwrite = false,
76
- const QMap<QString, QVariant> *options = 0,
77
- QProgressDialog *progress = 0
78
- );
76
+ const QMap<QString, QVariant> *options = 0 );
77
+ %Docstring
78
+ Constructor for QgsVectorLayerImport.
79
+ \param uri URI for destination data source
80
+ \param provider string key for destination data provider
81
+ \param fields fields to include in created layer
82
+ \param geometryType destination geometry type
83
+ \param crs desired CRS, or an invalid (default constructed) CRS if
84
+ not available
85
+ \param overwrite set to true to overwrite any existing data source
86
+ \param options optional provider dataset options
87
+ %End
88
+
79
89
80
- /** Checks whether there were any errors */
81
90
ImportError hasError();
91
+ %Docstring
92
+ Checks whether there were any errors
93
+ :rtype: ImportError
94
+ %End
82
95
83
- /** Retrieves error message */
84
96
QString errorMessage();
97
+ %Docstring
98
+ Retrieves error message
99
+ :rtype: str
100
+ %End
85
101
86
102
int errorCount() const;
103
+ %Docstring
104
+ :rtype: int
105
+ %End
87
106
88
- /** Add feature to the new created layer */
89
- bool addFeature( QgsFeature &feature );
107
+ virtual bool addFeatures( QgsFeatureList &features );
90
108
91
- /** Close the new created layer */
92
- ~QgsVectorLayerImport();
109
+ virtual bool addFeature( QgsFeature &feature );
93
110
94
- protected:
95
- /** Flush the buffer writing the features to the new layer */
96
- bool flushBuffer();
97
111
98
- /** Create index */
99
- bool createSpatialIndex();
112
+ ~QgsVectorLayerImport();
113
+ %Docstring
114
+ Close the new created layer
115
+ %End
100
116
101
117
private:
102
-
103
118
QgsVectorLayerImport( const QgsVectorLayerImport &rh );
104
119
};
120
+
121
+ /************************************************************************
122
+ * This file has been generated automatically from *
123
+ * *
124
+ * src/core/qgsvectorlayerimport.h *
125
+ * *
126
+ * Do not edit manually ! Edit header and run scripts/sipify.pl again *
127
+ ************************************************************************/
0 commit comments