QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
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
189 {
190 Original = 0,
192 };
193
199 {
200 SortRecommended = 1 << 1,
201 SkipNonSpatialFormats = 1 << 2,
202 SupportsMultipleLayers = 1 << 3,
203 };
204 Q_DECLARE_FLAGS( VectorFormatOptions, VectorFormatOption )
205
206
211 class CORE_EXPORT FieldValueConverter
212 {
213 public:
216
217 virtual ~FieldValueConverter() = default;
218
224 virtual QgsField fieldDefinition( const QgsField &field );
225
232 virtual QVariant convert( int fieldIdxInLayer, const QVariant &value );
233
238 };
239
245 {
247 CanAddNewLayer = 1 << 0,
248
250 CanAppendToExistingLayer = 1 << 1,
251
253 CanAddNewFieldsToExistingLayer = 1 << 2,
254
256 CanDeleteLayer = 1 << 3
257 };
258
263 Q_DECLARE_FLAGS( EditionCapabilities, EditionCapability )
264
265
270 {
273
276
279
281 AppendToLayerAddFields
282 };
283
284#ifndef SIP_RUN
285
311#else
312
337#endif
338 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
339 const QString &fileName,
340 const QString &fileEncoding,
342 const QString &driverName = "GPKG",
343 bool onlySelected = false,
344 QString *errorMessage SIP_OUT = nullptr,
345 const QStringList &datasourceOptions = QStringList(),
346 const QStringList &layerOptions = QStringList(),
347 bool skipAttributeCreation = false,
348 QString *newFilename = nullptr,
350 double symbologyScale = 1.0,
351 const QgsRectangle *filterExtent = nullptr,
352 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown,
353 bool forceMulti = false,
354 bool includeZ = false,
355 const QgsAttributeList &attributes = QgsAttributeList(),
356 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
357#ifndef SIP_RUN
358 , QString *newLayer = nullptr );
359#else
361#endif
362
363#ifndef SIP_RUN
364
392#else
393
420#endif
421 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
422 const QString &fileName,
423 const QString &fileEncoding,
424 const QgsCoordinateTransform &ct,
425 const QString &driverName = "GPKG",
426 bool onlySelected = false,
427 QString *errorMessage SIP_OUT = nullptr,
428 const QStringList &datasourceOptions = QStringList(),
429 const QStringList &layerOptions = QStringList(),
430 bool skipAttributeCreation = false,
431 QString *newFilename = nullptr,
433 double symbologyScale = 1.0,
434 const QgsRectangle *filterExtent = nullptr,
435 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown,
436 bool forceMulti = false,
437 bool includeZ = false,
438 const QgsAttributeList &attributes = QgsAttributeList(),
439 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
440#ifndef SIP_RUN
441 , QString *newLayer = nullptr );
442#else
444#endif
445
451 class CORE_EXPORT SaveVectorOptions
452 {
453 public:
456
457 virtual ~SaveVectorOptions() = default;
458
460 QString driverName;
461
463 QString layerName;
464
466 QgsVectorFileWriter::ActionOnExistingFile actionOnExistingFile = CreateOrOverwriteFile;
467
470
476
478 bool onlySelectedFeatures = false;
479
481 QStringList datasourceOptions;
482
484 QStringList layerOptions;
485
487 bool skipAttributeCreation = false;
488
491
494
497
499 double symbologyScale = 1.0;
500
503
508 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown;
509
511 bool forceMulti = false;
512
514 bool includeZ = false;
515
522 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr;
523
525 QgsFeedback *feedback = nullptr;
526
532 FieldNameSource fieldNameSource = Original;
533
540 bool saveMetadata = false;
541
549 };
550
551#ifndef SIP_RUN
552
564#else
565
576#endif
577 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
578 const QString &fileName,
580 QString *newFilename = nullptr,
581 QString *errorMessage SIP_OUT = nullptr
582#ifndef SIP_RUN
583 , QString *newLayer = nullptr );
584#else
586#endif
587
592 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
593 const QString &fileEncoding,
594 const QgsFields &fields,
595 Qgis::WkbType geometryType,
597 const QString &driverName = "GPKG",
598 const QStringList &datasourceOptions = QStringList(),
599 const QStringList &layerOptions = QStringList(),
600 QString *newFilename = nullptr,
602 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags()
603#ifndef SIP_RUN
604 , QString *newLayer = nullptr,
606 FieldNameSource fieldNameSource = Original
607#endif
609
632 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
633 const QString &fileEncoding,
634 const QgsFields &fields,
635 Qgis::WkbType geometryType,
637 const QString &driverName,
638 const QStringList &datasourceOptions,
639 const QStringList &layerOptions,
640 QString *newFilename,
641 Qgis::FeatureSymbologyExport symbologyExport,
642 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
643 const QString &layerName,
645 QString *newLayer = nullptr,
647 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
648 FieldNameSource fieldNameSource = Original
649 ) SIP_SKIP;
650
655
669 static QgsVectorFileWriter *create( const QString &fileName,
670 const QgsFields &fields,
671 Qgis::WkbType geometryType,
673 const QgsCoordinateTransformContext &transformContext,
675 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
676 QString *newFilename = nullptr,
677 QString *newLayer = nullptr ) SIP_FACTORY;
678
691 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( QgsVectorLayer *layer,
692 const QString &fileName,
693 const QgsCoordinateTransformContext &transformContext,
695 QString *newFilename = nullptr,
696 QString *newLayer = nullptr,
697 QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
698
711 static QgsVectorFileWriter::WriterError writeAsVectorFormatV3( QgsVectorLayer *layer,
712 const QString &fileName,
713 const QgsCoordinateTransformContext &transformContext,
715 QString *errorMessage SIP_OUT = nullptr,
716 QString *newFilename SIP_OUT = nullptr,
717 QString *newLayer SIP_OUT = nullptr );
718
724 {
726 QString driverName;
727
730
735 QStringList globs;
736 };
737
746 static QList< QgsVectorFileWriter::FilterFormatDetails > supportedFiltersAndFormats( VectorFormatOptions options = SortRecommended );
747
757 static QStringList supportedFormatExtensions( VectorFormatOptions options = SortRecommended );
758
766 static bool supportsFeatureStyles( const QString &driverName );
767
773 {
775 QString longName;
776
778 QString driverName;
779 };
780
792 static QList< QgsVectorFileWriter::DriverDetails > ogrDriverList( VectorFormatOptions options = SortRecommended );
793
800 static QString driverForExtension( const QString &extension );
801
808 static QString fileFilterString( VectorFormatOptions options = SortRecommended );
809
811 static QString filterForDriver( const QString &driverName );
812
814 static QString convertCodecNameForEncodingOption( const QString &codecName );
815
817 QgsVectorFileWriter::WriterError hasError() const;
818
820 QString errorMessage() const;
821
828 QString driver() const;
829
836 QString driverLongName() const;
837
843 Qgis::VectorFileWriterCapabilities capabilities() const;
844
845 bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
846 bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
847 QString lastError() const override;
848
853 bool addFeatureWithStyle( QgsFeature &feature, QgsFeatureRenderer *renderer, Qgis::DistanceUnit outputUnit = Qgis::DistanceUnit::Meters );
854
856 QMap<int, int> attrIdxToOgrIdx() const { return mAttrIdxToOgrIdx; } SIP_SKIP
857
859 ~QgsVectorFileWriter() override;
860
866 static bool deleteShapeFile( const QString &fileName );
867
873 Qgis::FeatureSymbologyExport symbologyExport() const { return mSymbologyExport; }
874
880 void setSymbologyExport( Qgis::FeatureSymbologyExport symExport ) { mSymbologyExport = symExport; }
881
888 double symbologyScale() const { return mSymbologyScale; }
889
896 void setSymbologyScale( double scale );
897
898 static bool driverMetadata( const QString &driverName, MetaData &driverMetadata );
899
906 static QStringList defaultDatasetOptions( const QString &driverName );
907
914 static QStringList defaultLayerOptions( const QString &driverName );
915
922 static OGRwkbGeometryType ogrTypeFromWkbType( Qgis::WkbType type ) SIP_SKIP;
923
928 static QgsVectorFileWriter::EditionCapabilities editionCapabilities( const QString &datasetName );
929
934 static bool targetLayerExists( const QString &datasetName,
935 const QString &layerName );
936
941 static bool areThereNewFieldsToCreate( const QString &datasetName,
942 const QString &layerName,
943 QgsVectorLayer *layer,
944 const QgsAttributeList &attributes );
945
946 protected:
948 OGRGeometryH createEmptyGeometry( Qgis::WkbType wkbType ) SIP_SKIP;
949
951 OGRLayerH mLayer = nullptr;
952 OGRSpatialReferenceH mOgrRef = nullptr;
953
955
959
960 QTextCodec *mCodec = nullptr;
961
964
966 QMap<int, int> mAttrIdxToOgrIdx;
967
969
970 QMap< QgsSymbolLayer *, QString > mSymbolLayerTable;
971
974
977
979 FieldValueConverter *mFieldValueConverter = nullptr;
980
981 private:
982#ifdef SIP_RUN
984#endif
985
986 struct PreparedWriterDetails
987 {
988 std::unique_ptr< QgsFeatureRenderer > renderer;
991 QgsFields sourceFields;
992 QString providerType;
993 long long featureCount = 0;
994 QgsFeatureIds selectedFeatureIds;
995 QString dataSourceUri;
996 QString storageType;
997 QgsFeatureIterator geometryTypeScanIterator;
998 QgsExpressionContext expressionContext;
999 QSet< int > fieldsToConvertToInt;
1000 QgsRenderContext renderContext;
1001 bool shallTransform = false;
1004 QgsAttributeList attributes;
1005 QgsFields outputFields;
1006 QgsFeatureIterator sourceFeatureIterator;
1007 QgsGeometry filterRectGeometry;
1008 std::unique_ptr< QgsGeometryEngine > filterRectEngine;
1009 QVariantMap providerUriParams;
1010 };
1011
1016 static QgsVectorFileWriter::WriterError prepareWriteAsVectorFormat( QgsVectorLayer *layer,
1018 PreparedWriterDetails &details );
1019
1033 static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( PreparedWriterDetails &details,
1034 const QString &fileName,
1035 const QgsCoordinateTransformContext &transformContext,
1037 QString *newFilename = nullptr,
1038 QString *newLayer = nullptr,
1039 QString *errorMessage SIP_OUT = nullptr );
1040
1046 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( PreparedWriterDetails &details,
1047 const QString &fileName,
1049 QString *newFilename = nullptr,
1050 QString *errorMessage SIP_OUT = nullptr,
1051 QString *newLayer = nullptr ) SIP_DEPRECATED;
1052
1053 void init( QString vectorFileName, QString fileEncoding, const QgsFields &fields,
1054 Qgis::WkbType geometryType, QgsCoordinateReferenceSystem srs,
1055 const QString &driverName, QStringList datasourceOptions,
1056 QStringList layerOptions, QString *newFilename,
1057 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
1058 const QString &layerName,
1059 QgsVectorFileWriter::ActionOnExistingFile action, QString *newLayer, QgsFeatureSink::SinkFlags sinkFlags,
1060 const QgsCoordinateTransformContext &transformContext,
1061 FieldNameSource fieldNameSource );
1062 void resetMap( const QgsAttributeList &attributes );
1063
1064 std::unique_ptr< QgsFeatureRenderer > mRenderer;
1065 QgsRenderContext mRenderContext;
1066
1067
1068 std::unique_ptr< QgsCoordinateTransform > mCoordinateTransform;
1069
1070 bool mUsingTransaction = false;
1071 QSet< QVariant::Type > mSupportedListSubTypes;
1072
1073 Qgis::VectorFileWriterCapabilities mCapabilities;
1074
1075 void createSymbolLayerTable( QgsVectorLayer *vl, const QgsCoordinateTransform &ct, OGRDataSourceH ds );
1076 gdal::ogr_feature_unique_ptr createFeature( const QgsFeature &feature );
1077 bool writeFeature( OGRLayerH layer, OGRFeatureH feature );
1078
1080 QgsVectorFileWriter::WriterError exportFeaturesSymbolLevels( const PreparedWriterDetails &details, QgsFeatureIterator &fit, const QgsCoordinateTransform &ct, QString *errorMessage = nullptr );
1081 double mmScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1082 double mapUnitScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1083
1084 void startRender( QgsFeatureRenderer *sourceRenderer, const QgsFields &fields );
1085 void stopRender();
1086 std::unique_ptr< QgsFeatureRenderer > createSymbologyRenderer( QgsFeatureRenderer *sourceRenderer ) const;
1088 static void addRendererAttributes( QgsFeatureRenderer *renderer, QgsRenderContext &context, const QgsFields &fields, QgsAttributeList &attList );
1089
1091 static QStringList concatenateOptions( const QMap<QString, Option *> &options );
1092
1094 friend class TestQgsVectorFileWriter;
1095};
1096
1099
1100// clazy:excludeall=qstring-allocations
1101
1102#endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:54
DistanceUnit
Units of distance.
Definition: qgis.h:3310
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition: qgis.h:154
@ Unknown
Unknown.
FeatureSymbologyExport
Options for exporting features considering their symbology.
Definition: qgis.h:3635
@ NoSymbology
Export only data.
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:53
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.
VectorFormatOption
Options for sorting and filtering vector formats.
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
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:27
const QgsField & field
Definition: qgsfield.h:554
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,...