18#ifndef QGSVECTORLAYEREXPORTER_H
19#define QGSVECTORLAYEREXPORTER_H
68 const QString &providerKey,
70 bool onlySelected =
false,
71 QString *errorMessage
SIP_OUT =
nullptr,
72 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
88 const QString &provider,
92 bool overwrite =
false,
93 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
111 QString errorMessage()
const;
141 bool createSpatialIndex();
145 QString mErrorMessage;
152 QMap<int, int> mOldToNewAttrIdx;
156 int mFeatureBufferMemoryUsage = 0;
158 bool mCreateSpatialIndex =
true;
190 const QString &providerKey,
192 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
193 bool ownsLayer =
false );
203 const QString &providerKey,
205 const QMap<QString, QVariant> &options = QMap<QString, QVariant>() )
SIP_FACTORY;
207 void cancel()
override;
225 void finished(
bool result )
override;
229 QPointer< QgsVectorLayer > mLayer =
nullptr;
230 bool mOwnsLayer =
false;
233 QString mDestProviderKey;
235 QMap<QString, QVariant> mOptions;
237 std::unique_ptr< QgsFeedback > mOwnedFeedback;
240 QString mErrorMessage;
VectorExportResult
Vector layer export result codes.
@ Success
No errors were encountered.
QFlags< VectorDataProviderAttributeEditCapability > VectorDataProviderAttributeEditCapabilities
Attribute editing capabilities which may be supported by vector data providers.
WkbType
The WKB type describes the number of dimensions a geometry has.
This class represents a coordinate reference system (CRS).
An interface for objects which accept features via addFeature(s) methods.
QFlags< SinkFlag > SinkFlags
virtual bool flushBuffer()
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to...
virtual bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())
Adds a single feature to the sink.
virtual QString lastError() const
Returns the most recent error encountered by the sink, e.g.
virtual bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())=0
Adds a list of features to the sink.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Container of fields for a vector layer.
Abstract base class for long running background tasks.
This is the base class for vector data providers.
QgsTask task which performs a QgsVectorLayerExporter layer export operation as a background task.
void exportComplete()
Emitted when exporting the layer is successfully completed.
void errorOccurred(Qgis::VectorExportResult error, const QString &errorMessage)
Emitted when an error occurs which prevented the layer being exported (or if the task is canceled).
A convenience class for exporting vector layers to a destination data provider.
QgsVectorLayerExporter & operator=(const QgsVectorLayerExporter &rh)=delete
int errorCount() const
Returns the number of error messages encountered during the export.
QgsVectorLayerExporter(const QgsVectorLayerExporter &rh)=delete
Represents a vector layer which manages a vector based data sets.
QList< QgsFeature > QgsFeatureList
const QgsCoordinateReferenceSystem & crs