QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
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"
24#include "qgsfields.h"
25#include "qgsfeedback.h"
26#include "qgsogrutils.h"
27#include "qgsrenderer.h"
28#include "qgsgeometryengine.h"
29#include "qgsfeaturesink.h"
30#include "qgsrendercontext.h"
31#include <ogr_api.h>
32
33class QgsSymbolLayer;
34class QTextCodec;
36
46class CORE_EXPORT QgsVectorFileWriter : public QgsFeatureSink
47{
48 public:
50 {
54 Hidden
55 };
56
60 class Option
61 {
62 public:
63 Option( const QString &docString, QgsVectorFileWriter::OptionType type )
64 : docString( docString )
65 , type( type ) {}
66 virtual ~Option() = default;
67
68 QString docString;
70 };
71
76 {
77 public:
78 SetOption( const QString &docString, const QStringList &values, const QString &defaultValue, bool allowNone = false )
79 : Option( docString, Set )
80 , values( values.begin(), values.end() )
81 , defaultValue( defaultValue )
82 , allowNone( allowNone )
83 {}
84
85 QSet<QString> values;
86 QString defaultValue;
88 };
89
94 {
95 public:
96 StringOption( const QString &docString, const QString &defaultValue = QString() )
97 : Option( docString, String )
98 , defaultValue( defaultValue )
99 {}
100
102 };
103
108 {
109 public:
110 IntOption( const QString &docString, int defaultValue )
111 : Option( docString, Int )
112 , defaultValue( defaultValue )
113 {}
114
116 };
117
122 {
123 public:
124 BoolOption( const QString &docString, bool defaultValue )
125 : SetOption( docString, QStringList() << QStringLiteral( "YES" ) << QStringLiteral( "NO" ), defaultValue ? "YES" : "NO" )
126 {}
127 };
128
133 {
134 public:
135 explicit HiddenOption( const QString &value )
136 : Option( QString(), Hidden )
137 , mValue( value )
138 {}
139
140 QString mValue;
141 };
142
143 struct MetaData
144 {
146 MetaData() = default;
147
148 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() )
149 : longName( longName )
150 , trLongName( trLongName )
151 , glob( glob )
152 , ext( ext )
153 , driverOptions( driverOptions )
154 , layerOptions( layerOptions )
155 , compulsoryEncoding( compulsoryEncoding )
156 {}
157
158 QString longName;
159 QString trLongName;
160 QString glob;
161 QString ext;
162 QMap<QString, QgsVectorFileWriter::Option *> driverOptions;
163 QMap<QString, QgsVectorFileWriter::Option *> layerOptions;
166 };
167
169 {
170 NoError = 0,
181 };
182
184 {
185 NoSymbology = 0, //export only data
186 FeatureSymbology, //Keeps the number of features and export symbology per feature
187 SymbolLayerSymbology //Exports one feature per symbol layer (considering symbol levels)
188 };
189
196 {
197 Original = 0,
199 };
200
206 {
207 SortRecommended = 1 << 1,
208 SkipNonSpatialFormats = 1 << 2,
209 };
210 Q_DECLARE_FLAGS( VectorFormatOptions, VectorFormatOption )
211
212
217 class CORE_EXPORT FieldValueConverter
218 {
219 public:
222
223 virtual ~FieldValueConverter() = default;
224
230 virtual QgsField fieldDefinition( const QgsField &field );
231
238 virtual QVariant convert( int fieldIdxInLayer, const QVariant &value );
239
244 };
245
251 {
253 CanAddNewLayer = 1 << 0,
254
256 CanAppendToExistingLayer = 1 << 1,
257
259 CanAddNewFieldsToExistingLayer = 1 << 2,
260
262 CanDeleteLayer = 1 << 3
263 };
264
269 Q_DECLARE_FLAGS( EditionCapabilities, EditionCapability )
270
271
276 {
279
282
285
287 AppendToLayerAddFields
288 };
289
290#ifndef SIP_RUN
291
317#else
318
343#endif
344 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
345 const QString &fileName,
346 const QString &fileEncoding,
348 const QString &driverName = "GPKG",
349 bool onlySelected = false,
350 QString *errorMessage SIP_OUT = nullptr,
351 const QStringList &datasourceOptions = QStringList(),
352 const QStringList &layerOptions = QStringList(),
353 bool skipAttributeCreation = false,
354 QString *newFilename = nullptr,
356 double symbologyScale = 1.0,
357 const QgsRectangle *filterExtent = nullptr,
358 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown,
359 bool forceMulti = false,
360 bool includeZ = false,
361 const QgsAttributeList &attributes = QgsAttributeList(),
362 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
363#ifndef SIP_RUN
364 , QString *newLayer = nullptr );
365#else
367#endif
368
369#ifndef SIP_RUN
370
398#else
399
426#endif
427 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
428 const QString &fileName,
429 const QString &fileEncoding,
430 const QgsCoordinateTransform &ct,
431 const QString &driverName = "GPKG",
432 bool onlySelected = false,
433 QString *errorMessage SIP_OUT = nullptr,
434 const QStringList &datasourceOptions = QStringList(),
435 const QStringList &layerOptions = QStringList(),
436 bool skipAttributeCreation = false,
437 QString *newFilename = nullptr,
439 double symbologyScale = 1.0,
440 const QgsRectangle *filterExtent = nullptr,
441 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown,
442 bool forceMulti = false,
443 bool includeZ = false,
444 const QgsAttributeList &attributes = QgsAttributeList(),
445 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
446#ifndef SIP_RUN
447 , QString *newLayer = nullptr );
448#else
450#endif
451
457 class CORE_EXPORT SaveVectorOptions
458 {
459 public:
462
463 virtual ~SaveVectorOptions() = default;
464
466 QString driverName;
467
469 QString layerName;
470
472 QgsVectorFileWriter::ActionOnExistingFile actionOnExistingFile = CreateOrOverwriteFile;
473
476
482
484 bool onlySelectedFeatures = false;
485
487 QStringList datasourceOptions;
488
490 QStringList layerOptions;
491
493 bool skipAttributeCreation = false;
494
497
500
502 QgsVectorFileWriter::SymbologyExport symbologyExport = NoSymbology;
503
505 double symbologyScale = 1.0;
506
509
514 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown;
515
517 bool forceMulti = false;
518
520 bool includeZ = false;
521
528 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr;
529
531 QgsFeedback *feedback = nullptr;
532
538 FieldNameSource fieldNameSource = Original;
539
546 bool saveMetadata = false;
547
555 };
556
557#ifndef SIP_RUN
558
570#else
571
582#endif
583 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
584 const QString &fileName,
586 QString *newFilename = nullptr,
587 QString *errorMessage SIP_OUT = nullptr
588#ifndef SIP_RUN
589 , QString *newLayer = nullptr );
590#else
592#endif
593
598 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
599 const QString &fileEncoding,
600 const QgsFields &fields,
601 Qgis::WkbType geometryType,
603 const QString &driverName = "GPKG",
604 const QStringList &datasourceOptions = QStringList(),
605 const QStringList &layerOptions = QStringList(),
606 QString *newFilename = nullptr,
608 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags()
609#ifndef SIP_RUN
610 , QString *newLayer = nullptr,
612 FieldNameSource fieldNameSource = Original
613#endif
615
638 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
639 const QString &fileEncoding,
640 const QgsFields &fields,
641 Qgis::WkbType geometryType,
643 const QString &driverName,
644 const QStringList &datasourceOptions,
645 const QStringList &layerOptions,
646 QString *newFilename,
648 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
649 const QString &layerName,
651 QString *newLayer = nullptr,
653 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
654 FieldNameSource fieldNameSource = Original
655 ) SIP_SKIP;
656
661
675 static QgsVectorFileWriter *create( const QString &fileName,
676 const QgsFields &fields,
677 Qgis::WkbType geometryType,
679 const QgsCoordinateTransformContext &transformContext,
681 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
682 QString *newFilename = nullptr,
683 QString *newLayer = nullptr ) SIP_FACTORY;
684
697 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( QgsVectorLayer *layer,
698 const QString &fileName,
699 const QgsCoordinateTransformContext &transformContext,
701 QString *newFilename = nullptr,
702 QString *newLayer = nullptr,
703 QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
704
717 static QgsVectorFileWriter::WriterError writeAsVectorFormatV3( QgsVectorLayer *layer,
718 const QString &fileName,
719 const QgsCoordinateTransformContext &transformContext,
721 QString *errorMessage SIP_OUT = nullptr,
722 QString *newFilename SIP_OUT = nullptr,
723 QString *newLayer SIP_OUT = nullptr );
724
730 {
732 QString driverName;
733
736
741 QStringList globs;
742 };
743
752 static QList< QgsVectorFileWriter::FilterFormatDetails > supportedFiltersAndFormats( VectorFormatOptions options = SortRecommended );
753
763 static QStringList supportedFormatExtensions( VectorFormatOptions options = SortRecommended );
764
772 static bool supportsFeatureStyles( const QString &driverName );
773
779 {
781 QString longName;
782
784 QString driverName;
785 };
786
798 static QList< QgsVectorFileWriter::DriverDetails > ogrDriverList( VectorFormatOptions options = SortRecommended );
799
806 static QString driverForExtension( const QString &extension );
807
814 static QString fileFilterString( VectorFormatOptions options = SortRecommended );
815
817 static QString filterForDriver( const QString &driverName );
818
820 static QString convertCodecNameForEncodingOption( const QString &codecName );
821
823 QgsVectorFileWriter::WriterError hasError() const;
824
826 QString errorMessage() const;
827
828 bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
829 bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
830 QString lastError() const override;
831
836 bool addFeatureWithStyle( QgsFeature &feature, QgsFeatureRenderer *renderer, Qgis::DistanceUnit outputUnit = Qgis::DistanceUnit::Meters );
837
839 QMap<int, int> attrIdxToOgrIdx() const { return mAttrIdxToOgrIdx; } SIP_SKIP
840
842 ~QgsVectorFileWriter() override;
843
849 static bool deleteShapeFile( const QString &fileName );
850
851 QgsVectorFileWriter::SymbologyExport symbologyExport() const { return mSymbologyExport; }
852 void setSymbologyExport( QgsVectorFileWriter::SymbologyExport symExport ) { mSymbologyExport = symExport; }
853
860 double symbologyScale() const { return mSymbologyScale; }
861
868 void setSymbologyScale( double scale );
869
870 static bool driverMetadata( const QString &driverName, MetaData &driverMetadata );
871
878 static QStringList defaultDatasetOptions( const QString &driverName );
879
886 static QStringList defaultLayerOptions( const QString &driverName );
887
894 static OGRwkbGeometryType ogrTypeFromWkbType( Qgis::WkbType type ) SIP_SKIP;
895
900 static QgsVectorFileWriter::EditionCapabilities editionCapabilities( const QString &datasetName );
901
906 static bool targetLayerExists( const QString &datasetName,
907 const QString &layerName );
908
913 static bool areThereNewFieldsToCreate( const QString &datasetName,
914 const QString &layerName,
915 QgsVectorLayer *layer,
916 const QgsAttributeList &attributes );
917
918 protected:
920 OGRGeometryH createEmptyGeometry( Qgis::WkbType wkbType ) SIP_SKIP;
921
923 OGRLayerH mLayer = nullptr;
924 OGRSpatialReferenceH mOgrRef = nullptr;
925
927
931
932 QTextCodec *mCodec = nullptr;
933
936
938 QMap<int, int> mAttrIdxToOgrIdx;
939
941
942 QMap< QgsSymbolLayer *, QString > mSymbolLayerTable;
943
946
948
950 FieldValueConverter *mFieldValueConverter = nullptr;
951
952 private:
953#ifdef SIP_RUN
955#endif
956
957 struct PreparedWriterDetails
958 {
959 std::unique_ptr< QgsFeatureRenderer > renderer;
962 QgsFields sourceFields;
963 QString providerType;
964 long long featureCount = 0;
965 QgsFeatureIds selectedFeatureIds;
966 QString dataSourceUri;
967 QString storageType;
968 QgsFeatureIterator geometryTypeScanIterator;
969 QgsExpressionContext expressionContext;
970 QSet< int > fieldsToConvertToInt;
971 QgsRenderContext renderContext;
972 bool shallTransform = false;
975 QgsAttributeList attributes;
976 QgsFields outputFields;
977 QgsFeatureIterator sourceFeatureIterator;
978 QgsGeometry filterRectGeometry;
979 std::unique_ptr< QgsGeometryEngine > filterRectEngine;
980 QVariantMap providerUriParams;
981 };
982
987 static QgsVectorFileWriter::WriterError prepareWriteAsVectorFormat( QgsVectorLayer *layer,
989 PreparedWriterDetails &details );
990
1004 static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( PreparedWriterDetails &details,
1005 const QString &fileName,
1006 const QgsCoordinateTransformContext &transformContext,
1008 QString *newFilename = nullptr,
1009 QString *newLayer = nullptr,
1010 QString *errorMessage SIP_OUT = nullptr );
1011
1017 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( PreparedWriterDetails &details,
1018 const QString &fileName,
1020 QString *newFilename = nullptr,
1021 QString *errorMessage SIP_OUT = nullptr,
1022 QString *newLayer = nullptr ) SIP_DEPRECATED;
1023
1024 void init( QString vectorFileName, QString fileEncoding, const QgsFields &fields,
1025 Qgis::WkbType geometryType, QgsCoordinateReferenceSystem srs,
1026 const QString &driverName, QStringList datasourceOptions,
1027 QStringList layerOptions, QString *newFilename,
1028 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
1029 const QString &layerName,
1030 QgsVectorFileWriter::ActionOnExistingFile action, QString *newLayer, QgsFeatureSink::SinkFlags sinkFlags,
1031 const QgsCoordinateTransformContext &transformContext,
1032 FieldNameSource fieldNameSource );
1033 void resetMap( const QgsAttributeList &attributes );
1034
1035 std::unique_ptr< QgsFeatureRenderer > mRenderer;
1036 QgsRenderContext mRenderContext;
1037
1038
1039 std::unique_ptr< QgsCoordinateTransform > mCoordinateTransform;
1040
1041 bool mUsingTransaction = false;
1042 QSet< QVariant::Type > mSupportedListSubTypes;
1043
1044 void createSymbolLayerTable( QgsVectorLayer *vl, const QgsCoordinateTransform &ct, OGRDataSourceH ds );
1045 gdal::ogr_feature_unique_ptr createFeature( const QgsFeature &feature );
1046 bool writeFeature( OGRLayerH layer, OGRFeatureH feature );
1047
1049 QgsVectorFileWriter::WriterError exportFeaturesSymbolLevels( const PreparedWriterDetails &details, QgsFeatureIterator &fit, const QgsCoordinateTransform &ct, QString *errorMessage = nullptr );
1050 double mmScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1051 double mapUnitScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1052
1053 void startRender( QgsFeatureRenderer *sourceRenderer, const QgsFields &fields );
1054 void stopRender();
1055 std::unique_ptr< QgsFeatureRenderer > createSymbologyRenderer( QgsFeatureRenderer *sourceRenderer ) const;
1057 static void addRendererAttributes( QgsFeatureRenderer *renderer, QgsRenderContext &context, const QgsFields &fields, QgsAttributeList &attList );
1058
1060 static QStringList concatenateOptions( const QMap<QString, Option *> &options );
1061
1063 friend class TestQgsVectorFileWriter;
1064};
1065
1068
1069// clazy:excludeall=qstring-allocations
1070
1071#endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:55
DistanceUnit
Units of distance.
Definition: qgis.h:3047
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition: qgis.h:155
@ Unknown
Unknown.
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.
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...
Definition: qgsfeature.h:56
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:45
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:52
Container of fields for a vector layer.
Definition: qgsfields.h:45
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:164
A structured metadata store for a map layer.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
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
QgsVectorFileWriter & operator=(const QgsVectorFileWriter &rh)=delete
QgsVectorFileWriter cannot be copied.
QgsVectorFileWriter(const QgsVectorFileWriter &rh)=delete
QgsVectorFileWriter cannot be copied.
double symbologyScale() const
Returns the reference scale for output.
SymbologyExport mSymbologyExport
VectorFormatOption
Options for sorting and filtering vector formats.
void setSymbologyExport(QgsVectorFileWriter::SymbologyExport symExport)
WriterError mError
Contains error value if construction was not successful.
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...
QgsVectorFileWriter::SymbologyExport symbologyExport() const
QMap< QgsSymbolLayer *, QString > mSymbolLayerTable
ActionOnExistingFile
Combination of CanAddNewLayer, CanAppendToExistingLayer, CanAddNewFieldsToExistingLayer or CanDeleteL...
@ 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< OGRFeatureH >::type, OGRFeatureDeleter > ogr_feature_unique_ptr
Scoped OGR feature.
Definition: qgsogrutils.h:152
std::unique_ptr< std::remove_pointer< OGRDataSourceH >::type, OGRDataSourceDeleter > ogr_datasource_unique_ptr
Scoped OGR data source.
Definition: qgsogrutils.h:137
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition: qgsgeos.h:74
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#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
Definition: qgsfeature.h:920
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:37
QList< int > QgsAttributeList
Definition: qgsfield.h:26
const QgsField & field
Definition: qgsfield.h:501
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
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,...