QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
18 #ifndef QGSVECTORLAYEREXPORTER_H
19 #define QGSVECTORLAYEREXPORTER_H
21 #include "qgis_core.h"
32 class QProgressDialog;
69 const QString &providerKey,
71 bool onlySelected =
false,
72 QString *errorMessage
SIP_OUT =
nullptr,
73 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
89 const QString &provider,
93 bool overwrite =
false,
94 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
95 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() );
114 QString errorMessage()
const;
124 bool addFeature(
QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() )
override;
137 bool createSpatialIndex();
141 QString mErrorMessage;
148 QMap<int, int> mOldToNewAttrIdx;
152 int mFeatureBufferMemoryUsage = 0;
154 bool mCreateSpatialIndex =
true;
187 const QString &providerKey,
189 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
190 bool ownsLayer =
false );
200 const QString &providerKey,
202 const QMap<QString, QVariant> &options = QMap<QString, QVariant>() )
SIP_FACTORY;
211 void exportComplete();
222 void finished(
bool result )
override;
226 QPointer< QgsVectorLayer > mLayer =
nullptr;
227 bool mOwnsLayer =
false;
230 QString mDestProviderKey;
232 QMap<QString, QVariant> mOptions;
234 std::unique_ptr< QgsFeedback > mOwnedFeedback;
237 QString mErrorMessage;
241 #endif // QGSVECTORLAYEREXPORTER_H
VectorExportResult
Vector layer export result codes.
const QgsCoordinateReferenceSystem & crs
virtual bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())
Adds a single feature to the sink.
Container of fields for a vector layer.
int errorCount() const
Returns the number of error messages encountered during the export.
Type
The WKB type describes the number of dimensions a geometry has.
virtual void finished(bool result)
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether ...
virtual void cancel()
Notifies the task that it should terminate.
QgsTask task which performs a QgsVectorLayerExporter layer export operation as a background task....
Base class for feedback objects to be used for cancellation of something running in a worker thread.
QList< QgsFeature > QgsFeatureList
This class represents a coordinate reference system (CRS).
virtual QString lastError() const
Returns the most recent error encountered by the sink, e.g.
Represents a vector layer which manages a vector based data sets.
virtual bool flushBuffer()
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to...
A convenience class for exporting vector layers to a destination data provider.
virtual bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())=0
Adds a list of features to the sink.
This is the base class for vector data providers.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
virtual bool run()=0
Performs the task's operation.
An interface for objects which accept features via addFeature(s) methods.
Abstract base class for long running background tasks. Tasks can be controlled directly,...