18 #ifndef QGSVECTORLAYEREXPORTER_H 19 #define QGSVECTORLAYEREXPORTER_H 21 #include "qgis_core.h" 29 class QProgressDialog;
83 const QString &providerKey,
85 bool onlySelected =
false,
86 QString *errorMessage
SIP_OUT =
nullptr,
87 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
104 const QString &provider,
108 bool overwrite =
false,
109 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
110 QgsFeatureSink::SinkFlags sinkFlags =
nullptr );
129 QString errorMessage()
const;
151 bool createSpatialIndex();
155 QString mErrorMessage;
162 QMap<int, int> mOldToNewAttrIdx;
198 const QString &providerKey,
200 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
201 bool ownsLayer =
false );
211 const QString &providerKey,
213 const QMap<QString, QVariant> &options = QMap<QString, QVariant>() )
SIP_FACTORY;
222 void exportComplete();
228 void errorOccurred(
int error,
const QString &errorMessage );
233 void finished(
bool result )
override;
237 QPointer< QgsVectorLayer > mLayer =
nullptr;
238 bool mOwnsLayer =
false;
241 QString mDestProviderKey;
243 QMap<QString, QVariant> mOptions;
245 std::unique_ptr< QgsFeedback > mOwnedFeedback;
248 QString mErrorMessage;
252 #endif // QGSVECTORLAYEREXPORTER_H Source layer has an attribute type which could not be handled by destination.
Could not access newly created destination layer.
int errorCount() const
Returns the number of error messages encountered during the export.
QList< QgsFeature > QgsFeatureList
An interface for objects which accept features via addFeature(s) methods.
Container of fields for a vector layer.
User canceled the export.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
const QgsCoordinateReferenceSystem & crs
Could not find a matching provider key.
Base class for feedback objects to be used for cancellation of something running in a worker thread...
Type
The WKB type describes the number of dimensions a geometry has.
Could not connect to destination.
Destination provider was unable to create an attribute.
Abstract base class for long running background tasks.
Could not create the destination data source.
An error occurred while writing a feature to the destination.
virtual bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=nullptr)
Adds a single feature to the sink.
QgsTask task which performs a QgsVectorLayerExporter layer export operation as a background task...
An error occurred while reprojecting features to destination CRS.
A convenience class for exporting vector layers to a destination data provider.
virtual bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=nullptr)=0
Adds a list of features to the sink.
virtual bool flushBuffer()
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to...
virtual void cancel()
Notifies the task that it should terminate.
This class represents a coordinate reference system (CRS).
virtual void finished(bool result)
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether ...
virtual bool run()=0
Performs the task's operation.
No errors were encountered.
Could not create destination layer.
This is the base class for vector data providers.
Represents a vector layer which manages a vector based data sets.
Provider does not support creation of empty layers.