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
+ ************************************************************************/
8
+
9
+
10
+
11
+
1
12
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
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,111 @@ 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
76
const QMap<QString, QVariant> *options = 0,
77
77
QProgressDialog *progress = 0
78
78
);
79
+ %Docstring
80
+ Constructor for QgsVectorLayerImport.
81
+ \param uri URI for destination data source
82
+ \param provider string key for destination data provider
83
+ \param fields fields to include in created layer
84
+ \param geometryType destination geometry type
85
+ \param crs desired CRS, or an invalid (default constructed) CRS if
86
+ not available
87
+ \param overwrite set to true to overwrite any existing data source
88
+ \param options optional provider dataset options
89
+ \param progress optional progress dialog to show progress of export
90
+ %End
91
+
79
92
80
- /** Checks whether there were any errors */
81
93
ImportError hasError();
94
+ %Docstring
95
+ Checks whether there were any errors
96
+ :rtype: ImportError
97
+ %End
82
98
83
- /** Retrieves error message */
84
99
QString errorMessage();
100
+ %Docstring
101
+ Retrieves error message
102
+ :rtype: str
103
+ %End
85
104
86
105
int errorCount() const;
106
+ %Docstring
107
+ :rtype: int
108
+ %End
109
+
110
+ virtual bool addFeatures( QgsFeatureList &features );
111
+
112
+ virtual bool addFeature( QgsFeature &feature );
87
113
88
- bool addFeatures( QgsFeatureList &features );
89
- bool addFeature( QgsFeature &feature );
90
114
91
- /** Close the new created layer */
92
115
~QgsVectorLayerImport();
116
+ %Docstring
117
+ Close the new created layer
118
+ %End
93
119
94
120
protected:
95
- /** Flush the buffer writing the features to the new layer */
96
121
bool flushBuffer();
122
+ %Docstring
123
+ Flush the buffer writing the features to the new layer
124
+ :rtype: bool
125
+ %End
97
126
98
- /** Create index */
99
127
bool createSpatialIndex();
128
+ %Docstring
129
+ Create index
130
+ :rtype: bool
131
+ %End
100
132
101
- private:
102
133
134
+
135
+
136
+
137
+
138
+ private:
103
139
QgsVectorLayerImport( const QgsVectorLayerImport &rh );
104
140
};
141
+
142
+ /************************************************************************
143
+ * This file has been generated automatically from *
144
+ * *
145
+ * src/core/qgsvectorlayerimport.h *
146
+ * *
147
+ * Do not edit manually ! Edit header and run scripts/sipify.pl again *
148
+ ************************************************************************/
0 commit comments