QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
qgsvectorfilewriter.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectorfilewriter.h
3 generic vector file writer
4 -------------------
5 begin : Jun 6 2004
6 copyright : (C) 2004 by Tim Sutton
7 email : tim at linfiniti.com
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19#ifndef QGSVECTORFILEWRITER_H
20#define QGSVECTORFILEWRITER_H
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
25#include "qgsfields.h"
26#include "qgsfeedback.h"
27#include "qgsogrutils.h"
28#include "qgsrenderer.h"
29#include "qgsgeometryengine.h"
30#include "qgsfeaturesink.h"
31#include "qgsrendercontext.h"
32#include <ogr_api.h>
33
34class QgsSymbolLayer;
35class QTextCodec;
37
47class CORE_EXPORT QgsVectorFileWriter : public QgsFeatureSink
48{
49 public:
51 {
55 Hidden
56 };
57
61 class Option
62 {
63 public:
64 Option( const QString &docString, QgsVectorFileWriter::OptionType type )
65 : docString( docString )
66 , type( type ) {}
67 virtual ~Option() = default;
68
69 QString docString;
71 };
72
77 {
78 public:
79 SetOption( const QString &docString, const QStringList &values, const QString &defaultValue, bool allowNone = false )
80 : Option( docString, Set )
81 , values( values.begin(), values.end() )
82 , defaultValue( defaultValue )
83 , allowNone( allowNone )
84 {}
85
86 QSet<QString> values;
87 QString defaultValue;
89 };
90
95 {
96 public:
97 StringOption( const QString &docString, const QString &defaultValue = QString() )
98 : Option( docString, String )
99 , defaultValue( defaultValue )
100 {}
101
103 };
104
109 {
110 public:
111 IntOption( const QString &docString, int defaultValue )
112 : Option( docString, Int )
113 , defaultValue( defaultValue )
114 {}
115
117 };
118
123 {
124 public:
125 BoolOption( const QString &docString, bool defaultValue )
126 : SetOption( docString, QStringList() << QStringLiteral( "YES" ) << QStringLiteral( "NO" ), defaultValue ? "YES" : "NO" )
127 {}
128 };
129
134 {
135 public:
136 explicit HiddenOption( const QString &value )
137 : Option( QString(), Hidden )
138 , mValue( value )
139 {}
140
141 QString mValue;
142 };
143
144 struct MetaData
145 {
146
147 MetaData() = default;
148
149 MetaData( const QString &longName, const QString &trLongName, const QString &glob, const QString &ext, const QMap<QString, QgsVectorFileWriter::Option *> &driverOptions, const QMap<QString, QgsVectorFileWriter::Option *> &layerOptions, const QString &compulsoryEncoding = QString() )
150 : longName( longName )
151 , trLongName( trLongName )
152 , glob( glob )
153 , ext( ext )
154 , driverOptions( driverOptions )
155 , layerOptions( layerOptions )
156 , compulsoryEncoding( compulsoryEncoding )
157 {}
158
159 QString longName;
160 QString trLongName;
161 QString glob;
162 QString ext;
163 QMap<QString, QgsVectorFileWriter::Option *> driverOptions;
164 QMap<QString, QgsVectorFileWriter::Option *> layerOptions;
167 };
168
183
190 {
191 Original = 0,
193 };
194
199 {
200 SortRecommended = 1 << 1,
201 SkipNonSpatialFormats = 1 << 2,
202 SupportsMultipleLayers = 1 << 3,
203 };
205
206
210 class CORE_EXPORT FieldValueConverter
211 {
212 public:
213
215
216 virtual ~FieldValueConverter() = default;
217
223 virtual QgsField fieldDefinition( const QgsField &field );
224
231 virtual QVariant convert( int fieldIdxInLayer, const QVariant &value );
232
237 };
238
243 {
245 CanAddNewLayer = 1 << 0,
246
248 CanAppendToExistingLayer = 1 << 1,
249
251 CanAddNewFieldsToExistingLayer = 1 << 2,
252
254 CanDeleteLayer = 1 << 3
255 };
256
261
262
279
280#ifndef SIP_RUN
281
307#else
308
333#endif
334 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
335 const QString &fileName,
336 const QString &fileEncoding,
338 const QString &driverName = "GPKG",
339 bool onlySelected = false,
340 QString *errorMessage SIP_OUT = nullptr,
341 const QStringList &datasourceOptions = QStringList(),
342 const QStringList &layerOptions = QStringList(),
343 bool skipAttributeCreation = false,
344 QString *newFilename = nullptr,
346 double symbologyScale = 1.0,
347 const QgsRectangle *filterExtent = nullptr,
348 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown,
349 bool forceMulti = false,
350 bool includeZ = false,
351 const QgsAttributeList &attributes = QgsAttributeList(),
352 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
353#ifndef SIP_RUN
354 , QString *newLayer = nullptr );
355#else
357#endif
358
359#ifndef SIP_RUN
360
387#else
388
414#endif
415 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
416 const QString &fileName,
417 const QString &fileEncoding,
418 const QgsCoordinateTransform &ct,
419 const QString &driverName = "GPKG",
420 bool onlySelected = false,
421 QString *errorMessage SIP_OUT = nullptr,
422 const QStringList &datasourceOptions = QStringList(),
423 const QStringList &layerOptions = QStringList(),
424 bool skipAttributeCreation = false,
425 QString *newFilename = nullptr,
427 double symbologyScale = 1.0,
428 const QgsRectangle *filterExtent = nullptr,
429 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown,
430 bool forceMulti = false,
431 bool includeZ = false,
432 const QgsAttributeList &attributes = QgsAttributeList(),
433 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
434#ifndef SIP_RUN
435 , QString *newLayer = nullptr );
436#else
438#endif
439
444 class CORE_EXPORT SaveVectorOptions
445 {
446 public:
447
449
450 virtual ~SaveVectorOptions() = default;
451
453 QString driverName;
454
456 QString layerName;
457
459 QgsVectorFileWriter::ActionOnExistingFile actionOnExistingFile = CreateOrOverwriteFile;
460
463
469
471 bool onlySelectedFeatures = false;
472
474 QStringList datasourceOptions;
475
477 QStringList layerOptions;
478
480 bool skipAttributeCreation = false;
481
484
487
490
492 double symbologyScale = 1.0;
493
496
501 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown;
502
504 bool forceMulti = false;
505
507 bool includeZ = false;
508
515 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr;
516
518 QgsFeedback *feedback = nullptr;
519
525 FieldNameSource fieldNameSource = Original;
526
533 bool saveMetadata = false;
534
542
550 bool includeConstraints = false;
551
560 bool setFieldDomains = true;
561
570 const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection = nullptr;
571 };
572
573#ifndef SIP_RUN
574
585#else
586
596#endif
597 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
598 const QString &fileName,
600 QString *newFilename = nullptr,
601 QString *errorMessage SIP_OUT = nullptr
602#ifndef SIP_RUN
603 , QString *newLayer = nullptr );
604#else
606#endif
607
612 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
613 const QString &fileEncoding,
614 const QgsFields &fields,
615 Qgis::WkbType geometryType,
617 const QString &driverName = "GPKG",
618 const QStringList &datasourceOptions = QStringList(),
619 const QStringList &layerOptions = QStringList(),
620 QString *newFilename = nullptr,
623#ifndef SIP_RUN
624 , QString *newLayer = nullptr,
626 FieldNameSource fieldNameSource = Original
627#endif
629
655 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
656 const QString &fileEncoding,
657 const QgsFields &fields,
658 Qgis::WkbType geometryType,
660 const QString &driverName,
661 const QStringList &datasourceOptions,
662 const QStringList &layerOptions,
663 QString *newFilename,
664 Qgis::FeatureSymbologyExport symbologyExport,
665 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
666 const QString &layerName,
668 QString *newLayer = nullptr,
671 FieldNameSource fieldNameSource = Original,
672 bool includeConstraints = false,
673 bool setFieldDomains = true,
674 const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection = nullptr
675 ) SIP_SKIP;
676
678 QgsVectorFileWriter &operator=( const QgsVectorFileWriter &rh ) = delete;
679
693 static QgsVectorFileWriter *create( const QString &fileName,
694 const QgsFields &fields,
695 Qgis::WkbType geometryType,
697 const QgsCoordinateTransformContext &transformContext,
700 QString *newFilename = nullptr,
701 QString *newLayer = nullptr ) SIP_FACTORY;
702
715 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( QgsVectorLayer *layer,
716 const QString &fileName,
717 const QgsCoordinateTransformContext &transformContext,
719 QString *newFilename = nullptr,
720 QString *newLayer = nullptr,
721 QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
722
735 static QgsVectorFileWriter::WriterError writeAsVectorFormatV3( QgsVectorLayer *layer,
736 const QString &fileName,
737 const QgsCoordinateTransformContext &transformContext,
739 QString *errorMessage SIP_OUT = nullptr,
740 QString *newFilename SIP_OUT = nullptr,
741 QString *newLayer SIP_OUT = nullptr );
742
747 {
749 QString driverName;
750
753
758 QStringList globs;
759 };
760
769 static QList< QgsVectorFileWriter::FilterFormatDetails > supportedFiltersAndFormats( VectorFormatOptions options = SortRecommended );
770
779 static QStringList supportedFormatExtensions( VectorFormatOptions options = SortRecommended );
780
787 static bool supportsFeatureStyles( const QString &driverName );
788
793 {
795 QString longName;
796
798 QString driverName;
799 };
800
812 static QList< QgsVectorFileWriter::DriverDetails > ogrDriverList( VectorFormatOptions options = SortRecommended );
813
819 static QString driverForExtension( const QString &extension );
820
827 static QString fileFilterString( VectorFormatOptions options = SortRecommended );
828
830 static QString filterForDriver( const QString &driverName );
831
833 static QString convertCodecNameForEncodingOption( const QString &codecName );
834
836 QgsVectorFileWriter::WriterError hasError() const;
837
839 QString errorMessage() const;
840
847 QString driver() const;
848
855 QString driverLongName() const;
856
862 Qgis::VectorFileWriterCapabilities capabilities() const;
863
864 bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
865 bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
866 QString lastError() const override;
867
871 bool addFeatureWithStyle( QgsFeature &feature, QgsFeatureRenderer *renderer, Qgis::DistanceUnit outputUnit = Qgis::DistanceUnit::Meters );
872
874 QMap<int, int> attrIdxToOgrIdx() const { return mAttrIdxToOgrIdx; } SIP_SKIP
875
877 ~QgsVectorFileWriter() override;
878
884 static bool deleteShapeFile( const QString &fileName );
885
891 Qgis::FeatureSymbologyExport symbologyExport() const { return mSymbologyExport; }
892
898 void setSymbologyExport( Qgis::FeatureSymbologyExport symExport ) { mSymbologyExport = symExport; }
899
905 double symbologyScale() const { return mSymbologyScale; }
906
912 void setSymbologyScale( double scale );
913
914 static bool driverMetadata( const QString &driverName, MetaData &driverMetadata );
915
921 static QStringList defaultDatasetOptions( const QString &driverName );
922
928 static QStringList defaultLayerOptions( const QString &driverName );
929
936 static OGRwkbGeometryType ogrTypeFromWkbType( Qgis::WkbType type ) SIP_SKIP;
937
941 static QgsVectorFileWriter::EditionCapabilities editionCapabilities( const QString &datasetName );
942
946 static bool targetLayerExists( const QString &datasetName,
947 const QString &layerName );
948
952 static bool areThereNewFieldsToCreate( const QString &datasetName,
953 const QString &layerName,
954 QgsVectorLayer *layer,
955 const QgsAttributeList &attributes );
956
957 protected:
959 OGRGeometryH createEmptyGeometry( Qgis::WkbType wkbType ) SIP_SKIP;
960
962 OGRLayerH mLayer = nullptr;
963 OGRSpatialReferenceH mOgrRef = nullptr;
964
966
970
971 QTextCodec *mCodec = nullptr;
972
975
977 QMap<int, int> mAttrIdxToOgrIdx;
978
980
981 QMap< QgsSymbolLayer *, QString > mSymbolLayerTable;
982
985
988
990 FieldValueConverter *mFieldValueConverter = nullptr;
991
993 bool mIncludeConstraints = false;
994
996 bool mSetFieldDomains = true;
997
998 private:
999#ifdef SIP_RUN
1001#endif
1002
1003 struct PreparedWriterDetails
1004 {
1005 std::unique_ptr< QgsFeatureRenderer > renderer;
1007 Qgis::WkbType sourceWkbType = Qgis::WkbType::Unknown;
1008 QgsFields sourceFields;
1009 QString providerType;
1010 long long featureCount = 0;
1011 QgsFeatureIds selectedFeatureIds;
1012 QString dataSourceUri;
1013 QString storageType;
1014 QgsFeatureIterator geometryTypeScanIterator;
1015 QgsExpressionContext expressionContext;
1016 QSet< int > fieldsToConvertToInt;
1017 QgsRenderContext renderContext;
1018 bool shallTransform = false;
1021 QgsAttributeList attributes;
1022 QgsFields outputFields;
1023 QgsFeatureIterator sourceFeatureIterator;
1024 QgsGeometry filterRectGeometry;
1025 std::unique_ptr< QgsGeometryEngine > filterRectEngine;
1026 QVariantMap providerUriParams;
1027 std::unique_ptr< QgsAbstractDatabaseProviderConnection > sourceDatabaseProviderConnection;
1028 };
1029
1034 static QgsVectorFileWriter::WriterError prepareWriteAsVectorFormat( QgsVectorLayer *layer,
1036 PreparedWriterDetails &details );
1037
1052 static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( PreparedWriterDetails &details,
1053 const QString &fileName,
1054 const QgsCoordinateTransformContext &transformContext,
1056 QString *newFilename = nullptr,
1057 QString *newLayer = nullptr,
1058 QString *errorMessage SIP_OUT = nullptr,
1060
1066 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( PreparedWriterDetails &details,
1067 const QString &fileName,
1069 QString *newFilename = nullptr,
1070 QString *errorMessage SIP_OUT = nullptr,
1071 QString *newLayer = nullptr ) SIP_DEPRECATED;
1072
1073 void init( QString vectorFileName, QString fileEncoding, const QgsFields &fields,
1074 Qgis::WkbType geometryType, QgsCoordinateReferenceSystem srs,
1075 const QString &driverName, QStringList datasourceOptions,
1076 QStringList layerOptions, QString *newFilename,
1077 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
1078 const QString &layerName,
1079 QgsVectorFileWriter::ActionOnExistingFile action, QString *newLayer, QgsFeatureSink::SinkFlags sinkFlags,
1080 const QgsCoordinateTransformContext &transformContext,
1081 FieldNameSource fieldNameSource,
1082 const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection );
1083 void resetMap( const QgsAttributeList &attributes );
1084
1085 std::unique_ptr< QgsFeatureRenderer > mRenderer;
1086 QgsRenderContext mRenderContext;
1087
1088
1089 std::unique_ptr< QgsCoordinateTransform > mCoordinateTransform;
1090
1091 bool mUsingTransaction = false;
1092 QSet< QMetaType::Type > mSupportedListSubTypes;
1093
1094 Qgis::VectorFileWriterCapabilities mCapabilities;
1095
1096 void createSymbolLayerTable( QgsVectorLayer *vl, const QgsCoordinateTransform &ct, OGRDataSourceH ds );
1097 gdal::ogr_feature_unique_ptr createFeature( const QgsFeature &feature );
1098 bool writeFeature( OGRLayerH layer, OGRFeatureH feature );
1099
1101 QgsVectorFileWriter::WriterError exportFeaturesSymbolLevels( const PreparedWriterDetails &details, QgsFeatureIterator &fit, const QgsCoordinateTransform &ct, QString *errorMessage = nullptr );
1102 double mmScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1103 double mapUnitScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1104
1105 void startRender( QgsFeatureRenderer *sourceRenderer, const QgsFields &fields );
1106 void stopRender();
1107 std::unique_ptr< QgsFeatureRenderer > createSymbologyRenderer( QgsFeatureRenderer *sourceRenderer ) const;
1109 static void addRendererAttributes( QgsFeatureRenderer *renderer, QgsRenderContext &context, const QgsFields &fields, QgsAttributeList &attList );
1110
1112 static QStringList concatenateOptions( const QMap<QString, Option *> &options );
1113
1115 friend class TestQgsVectorFileWriter;
1116};
1117
1120
1121// clazy:excludeall=qstring-allocations
1122
1123#endif
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
DistanceUnit
Units of distance.
Definition qgis.h:4677
QFlags< VectorFileWriterCapability > VectorFileWriterCapabilities
Capabilities supported by a QgsVectorFileWriter object.
Definition qgis.h:1014
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:256
@ Unknown
Unknown.
FeatureSymbologyExport
Options for exporting features considering their symbology.
Definition qgis.h:5155
@ NoSymbology
Export only data.
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Class for doing transforms between two map coordinate systems.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Wrapper for iterator of features from vector data provider or vector layer.
Abstract base class for all 2D vector feature renderers.
An interface for objects which accept features via addFeature(s) methods.
QFlags< SinkFlag > SinkFlags
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.
QFlags< Flag > Flags
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
Encapsulate a field in an attribute table or data source.
Definition qgsfield.h:53
Container of fields for a vector layer.
Definition qgsfields.h:46
A geometry is the spatial representation of a feature.
A structured metadata store for a map layer.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
QgsTask task which performs a QgsVectorFileWriter layer saving operation as a background task.
BoolOption(const QString &docString, bool defaultValue)
Interface to convert raw field values to their user-friendly value.
IntOption(const QString &docString, int defaultValue)
Option(const QString &docString, QgsVectorFileWriter::OptionType type)
QgsVectorFileWriter::OptionType type
virtual ~Option()=default
Options to pass to writeAsVectorFormat()
QgsCoordinateTransform ct
Transform to reproject exported geometries with, or invalid transform for no transformation.
QStringList attributesExportNames
Attributes export names.
QgsLayerMetadata layerMetadata
Layer metadata to save for the exported vector file.
QString layerName
Layer name. If let empty, it will be derived from the filename.
QgsRectangle filterExtent
If not empty, only features intersecting the extent will be saved.
QStringList layerOptions
List of OGR layer creation options.
QgsAttributeList attributes
Attributes to export (empty means all unless skipAttributeCreation is set)
QStringList datasourceOptions
List of OGR data source creation options.
SetOption(const QString &docString, const QStringList &values, const QString &defaultValue, bool allowNone=false)
StringOption(const QString &docString, const QString &defaultValue=QString())
A convenience class for writing vector layers to disk based formats (e.g.
EditionCapability
Edition capability flags.
Qgis::WkbType mWkbType
Geometry type which is being used.
double mSymbologyScale
Scale for symbology export (e.g. for symbols units in map units)
QMap< int, int > attrIdxToOgrIdx() const
QMap< int, int > mAttrIdxToOgrIdx
Map attribute indizes to OGR field indexes.
@ Canceled
Writing was interrupted by manual cancellation.
@ ErrSavingMetadata
Metadata saving failed.
gdal::ogr_datasource_unique_ptr mDS
QFlags< EditionCapability > EditionCapabilities
Combination of CanAddNewLayer, CanAppendToExistingLayer, CanAddNewFieldsToExistingLayer or CanDeleteL...
double symbologyScale() const
Returns the reference scale for output.
VectorFormatOption
Options for sorting and filtering vector formats.
QFlags< VectorFormatOption > VectorFormatOptions
WriterError mError
Contains error value if construction was not successful.
Qgis::FeatureSymbologyExport symbologyExport() const
Returns the feature symbology export handling for the writer.
FieldNameSource
Source for exported field names.
@ PreferAlias
Use the field alias as the exported field name, wherever one is set. Otherwise use the original field...
void setSymbologyExport(Qgis::FeatureSymbologyExport symExport)
Sets the feature symbology export handling for the writer.
QMap< QgsSymbolLayer *, QString > mSymbolLayerTable
ActionOnExistingFile
Enumeration to describe how to handle existing files.
@ CreateOrOverwriteLayer
Create or overwrite layer.
@ CreateOrOverwriteFile
Create or overwrite file.
@ AppendToLayerNoNewFields
Append features to existing layer, but do not create new fields.
Represents a vector layer which manages a vector based data sets.
std::unique_ptr< std::remove_pointer< OGRDataSourceH >::type, OGRDataSourceDeleter > ogr_datasource_unique_ptr
Scoped OGR data source.
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:278
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_OUT
Definition qgis_sip.h:58
#define SIP_FACTORY
Definition qgis_sip.h:76
void * OGRSpatialReferenceH
QList< QgsFeature > QgsFeatureList
QSet< QgsFeatureId > QgsFeatureIds
QList< int > QgsAttributeList
Definition qgsfield.h:27
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)
const QgsCoordinateReferenceSystem & outputCrs
Details of available driver formats.
QString longName
Descriptive, user friendly name for the driver.
QString driverName
Unique driver name.
Details of available filters and formats.
QString filterString
Filter string for file picker dialogs.
QStringList globs
Matching glob patterns for format, e.g.
MetaData(const QString &longName, const QString &trLongName, const QString &glob, const QString &ext, const QMap< QString, QgsVectorFileWriter::Option * > &driverOptions, const QMap< QString, QgsVectorFileWriter::Option * > &layerOptions, const QString &compulsoryEncoding=QString())
QMap< QString, QgsVectorFileWriter::Option * > driverOptions
QMap< QString, QgsVectorFileWriter::Option * > layerOptions
QString compulsoryEncoding
Some formats require a compulsory encoding, typically UTF-8. If no compulsory encoding,...