QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
18 #ifndef QGSVECTORLAYEREXPORTER_H
19 #define QGSVECTORLAYEREXPORTER_H
21 #include "qgis_core.h"
29 class QProgressDialog;
82 const QString &providerKey,
84 bool onlySelected =
false,
85 QString *errorMessage
SIP_OUT =
nullptr,
86 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
103 const QString &provider,
107 bool overwrite =
false,
108 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
109 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() );
121 ExportError errorCode()
const;
128 QString errorMessage()
const;
138 bool addFeature(
QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() )
override;
150 bool createSpatialIndex();
154 QString mErrorMessage;
161 QMap<int, int> mOldToNewAttrIdx;
197 const QString &providerKey,
199 const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
200 bool ownsLayer =
false );
210 const QString &providerKey,
212 const QMap<QString, QVariant> &options = QMap<QString, QVariant>() )
SIP_FACTORY;
221 void exportComplete();
227 void errorOccurred(
int error,
const QString &errorMessage );
232 void finished(
bool result )
override;
236 QPointer< QgsVectorLayer > mLayer =
nullptr;
237 bool mOwnsLayer =
false;
240 QString mDestProviderKey;
242 QMap<QString, QVariant> mOptions;
244 std::unique_ptr< QgsFeedback > mOwnedFeedback;
247 QString mErrorMessage;
251 #endif // QGSVECTORLAYEREXPORTER_H
@ ErrProviderUnsupportedFeature
Provider does not support creation of empty layers.
const QgsCoordinateReferenceSystem & crs
virtual bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())
Adds a single feature to the sink.
int errorCount() const
Returns the number of error messages encountered during the export.
@ ErrFeatureWriteFailed
An error occurred while writing a feature to the destination.
Type
The WKB type describes the number of dimensions a geometry has.
@ NoError
No errors were encountered.
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.
@ ErrCreateDataSource
Could not create the destination data source.
QList< QgsFeature > QgsFeatureList
@ ErrInvalidLayer
Could not access newly created destination layer.
@ ErrUserCanceled
User canceled the export.
@ ErrCreateLayer
Could not create destination layer.
@ ErrInvalidProvider
Could not find a matching provider key.
@ ErrAttributeTypeUnsupported
Source layer has an attribute type which could not be handled by destination.
@ ErrConnectionFailed
Could not connect to destination.
virtual bool flushBuffer()
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to...
virtual bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())=0
Adds a list of features to the sink.
@ ErrProjection
An error occurred while reprojecting features to destination CRS.
virtual bool run()=0
Performs the task's operation.
@ ErrAttributeCreationFailed
Destination provider was unable to create an attribute.
Abstract base class for long running background tasks. Tasks can be controlled directly,...