QGIS API Documentation 3.37.0-Master (684a802617f)
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 {
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:
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:
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
680 QgsVectorFileWriter &operator=( const QgsVectorFileWriter &rh ) = delete;
681
695 static QgsVectorFileWriter *create( const QString &fileName,
696 const QgsFields &fields,
697 Qgis::WkbType geometryType,
699 const QgsCoordinateTransformContext &transformContext,
702 QString *newFilename = nullptr,
703 QString *newLayer = nullptr ) SIP_FACTORY;
704
717 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( QgsVectorLayer *layer,
718 const QString &fileName,
719 const QgsCoordinateTransformContext &transformContext,
721 QString *newFilename = nullptr,
722 QString *newLayer = nullptr,
723 QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
724
737 static QgsVectorFileWriter::WriterError writeAsVectorFormatV3( QgsVectorLayer *layer,
738 const QString &fileName,
739 const QgsCoordinateTransformContext &transformContext,
741 QString *errorMessage SIP_OUT = nullptr,
742 QString *newFilename SIP_OUT = nullptr,
743 QString *newLayer SIP_OUT = nullptr );
744
749 {
751 QString driverName;
752
755
760 QStringList globs;
761 };
762
771 static QList< QgsVectorFileWriter::FilterFormatDetails > supportedFiltersAndFormats( VectorFormatOptions options = SortRecommended );
772
781 static QStringList supportedFormatExtensions( VectorFormatOptions options = SortRecommended );
782
789 static bool supportsFeatureStyles( const QString &driverName );
790
795 {
797 QString longName;
798
800 QString driverName;
801 };
802
814 static QList< QgsVectorFileWriter::DriverDetails > ogrDriverList( VectorFormatOptions options = SortRecommended );
815
821 static QString driverForExtension( const QString &extension );
822
829 static QString fileFilterString( VectorFormatOptions options = SortRecommended );
830
832 static QString filterForDriver( const QString &driverName );
833
835 static QString convertCodecNameForEncodingOption( const QString &codecName );
836
838 QgsVectorFileWriter::WriterError hasError() const;
839
841 QString errorMessage() const;
842
849 QString driver() const;
850
857 QString driverLongName() const;
858
864 Qgis::VectorFileWriterCapabilities capabilities() const;
865
866 bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
867 bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
868 QString lastError() const override;
869
873 bool addFeatureWithStyle( QgsFeature &feature, QgsFeatureRenderer *renderer, Qgis::DistanceUnit outputUnit = Qgis::DistanceUnit::Meters );
874
876 QMap<int, int> attrIdxToOgrIdx() const { return mAttrIdxToOgrIdx; } SIP_SKIP
877
879 ~QgsVectorFileWriter() override;
880
886 static bool deleteShapeFile( const QString &fileName );
887
893 Qgis::FeatureSymbologyExport symbologyExport() const { return mSymbologyExport; }
894
900 void setSymbologyExport( Qgis::FeatureSymbologyExport symExport ) { mSymbologyExport = symExport; }
901
907 double symbologyScale() const { return mSymbologyScale; }
908
914 void setSymbologyScale( double scale );
915
916 static bool driverMetadata( const QString &driverName, MetaData &driverMetadata );
917
923 static QStringList defaultDatasetOptions( const QString &driverName );
924
930 static QStringList defaultLayerOptions( const QString &driverName );
931
938 static OGRwkbGeometryType ogrTypeFromWkbType( Qgis::WkbType type ) SIP_SKIP;
939
943 static QgsVectorFileWriter::EditionCapabilities editionCapabilities( const QString &datasetName );
944
948 static bool targetLayerExists( const QString &datasetName,
949 const QString &layerName );
950
954 static bool areThereNewFieldsToCreate( const QString &datasetName,
955 const QString &layerName,
956 QgsVectorLayer *layer,
957 const QgsAttributeList &attributes );
958
959 protected:
961 OGRGeometryH createEmptyGeometry( Qgis::WkbType wkbType ) SIP_SKIP;
962
964 OGRLayerH mLayer = nullptr;
965 OGRSpatialReferenceH mOgrRef = nullptr;
966
968
972
973 QTextCodec *mCodec = nullptr;
974
977
979 QMap<int, int> mAttrIdxToOgrIdx;
980
982
983 QMap< QgsSymbolLayer *, QString > mSymbolLayerTable;
984
987
990
992 FieldValueConverter *mFieldValueConverter = nullptr;
993
995 bool mIncludeConstraints = false;
996
998 bool mSetFieldDomains = true;
999
1000 private:
1001#ifdef SIP_RUN
1003#endif
1004
1005 struct PreparedWriterDetails
1006 {
1007 std::unique_ptr< QgsFeatureRenderer > renderer;
1009 Qgis::WkbType sourceWkbType = Qgis::WkbType::Unknown;
1010 QgsFields sourceFields;
1011 QString providerType;
1012 long long featureCount = 0;
1013 QgsFeatureIds selectedFeatureIds;
1014 QString dataSourceUri;
1015 QString storageType;
1016 QgsFeatureIterator geometryTypeScanIterator;
1017 QgsExpressionContext expressionContext;
1018 QSet< int > fieldsToConvertToInt;
1019 QgsRenderContext renderContext;
1020 bool shallTransform = false;
1023 QgsAttributeList attributes;
1024 QgsFields outputFields;
1025 QgsFeatureIterator sourceFeatureIterator;
1026 QgsGeometry filterRectGeometry;
1027 std::unique_ptr< QgsGeometryEngine > filterRectEngine;
1028 QVariantMap providerUriParams;
1029 std::unique_ptr< QgsAbstractDatabaseProviderConnection > sourceDatabaseProviderConnection;
1030 };
1031
1036 static QgsVectorFileWriter::WriterError prepareWriteAsVectorFormat( QgsVectorLayer *layer,
1038 PreparedWriterDetails &details );
1039
1053 static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( PreparedWriterDetails &details,
1054 const QString &fileName,
1055 const QgsCoordinateTransformContext &transformContext,
1057 QString *newFilename = nullptr,
1058 QString *newLayer = nullptr,
1059 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:4358
QFlags< VectorFileWriterCapability > VectorFileWriterCapabilities
Capabilities supported by a QgsVectorFileWriter object.
Definition qgis.h:834
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:201
@ Unknown
Unknown.
FeatureSymbologyExport
Options for exporting features considering their symbology.
Definition qgis.h:4711
@ 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.
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.
FieldValueConverter()=default
Constructor.
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())
MetaData()=default
Constructor for MetaData.
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,...