QGIS API Documentation 3.43.0-Master (32433f7016e)
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
62 class Option
63 {
64 public:
65 Option( const QString &docString, QgsVectorFileWriter::OptionType type )
66 : docString( docString )
67 , type( type ) {}
68 virtual ~Option() = default;
69
70 QString docString;
72 };
73
79 {
80 public:
81 SetOption( const QString &docString, const QStringList &values, const QString &defaultValue, bool allowNone = false )
82 : Option( docString, Set )
83 , values( values.begin(), values.end() )
84 , defaultValue( defaultValue )
85 , allowNone( allowNone )
86 {}
87
88 QSet<QString> values;
89 QString defaultValue;
91 };
92
98 {
99 public:
100 StringOption( const QString &docString, const QString &defaultValue = QString() )
101 : Option( docString, String )
102 , defaultValue( defaultValue )
103 {}
104
106 };
107
113 {
114 public:
115 IntOption( const QString &docString, int defaultValue )
116 : Option( docString, Int )
117 , defaultValue( defaultValue )
118 {}
119
121 };
122
128 {
129 public:
130 BoolOption( const QString &docString, bool defaultValue )
131 : SetOption( docString, QStringList() << QStringLiteral( "YES" ) << QStringLiteral( "NO" ), defaultValue ? "YES" : "NO" )
132 {}
133 };
134
140 {
141 public:
142 explicit HiddenOption( const QString &value )
143 : Option( QString(), Hidden )
144 , mValue( value )
145 {}
146
147 QString mValue;
148 };
149
150 struct MetaData
151 {
152
153 MetaData() = default;
154
155 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() )
156 : longName( longName )
157 , trLongName( trLongName )
158 , glob( glob )
159 , ext( ext )
160 , driverOptions( driverOptions )
161 , layerOptions( layerOptions )
162 , compulsoryEncoding( compulsoryEncoding )
163 {}
164
165 QString longName;
166 QString trLongName;
167 QString glob;
168 QString ext;
169 QMap<QString, QgsVectorFileWriter::Option *> driverOptions;
170 QMap<QString, QgsVectorFileWriter::Option *> layerOptions;
173 };
174
189
196 {
197 Original = 0,
199 };
200
205 {
206 SortRecommended = 1 << 1,
207 SkipNonSpatialFormats = 1 << 2,
208 SupportsMultipleLayers = 1 << 3,
209 };
211
212
216 class CORE_EXPORT FieldValueConverter
217 {
218 public:
219
221
222 virtual ~FieldValueConverter() = default;
223
229 virtual QgsField fieldDefinition( const QgsField &field );
230
237 virtual QVariant convert( int fieldIdxInLayer, const QVariant &value );
238
243 };
244
249 {
251 CanAddNewLayer = 1 << 0,
252
254 CanAppendToExistingLayer = 1 << 1,
255
257 CanAddNewFieldsToExistingLayer = 1 << 2,
258
260 CanDeleteLayer = 1 << 3
261 };
262
267
268
285
286#ifndef SIP_RUN
287
314#else
315
341#endif
342 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
343 const QString &fileName,
344 const QString &fileEncoding,
346 const QString &driverName = "GPKG",
347 bool onlySelected = false,
348 QString *errorMessage SIP_OUT = nullptr,
349 const QStringList &datasourceOptions = QStringList(),
350 const QStringList &layerOptions = QStringList(),
351 bool skipAttributeCreation = false,
352 QString *newFilename = nullptr,
354 double symbologyScale = 1.0,
355 const QgsRectangle *filterExtent = nullptr,
356 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown,
357 bool forceMulti = false,
358 bool includeZ = false,
359 const QgsAttributeList &attributes = QgsAttributeList(),
360 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
361#ifndef SIP_RUN
362 , QString *newLayer = nullptr );
363#else
365#endif
366
367#ifndef SIP_RUN
368
396#else
397
424#endif
425 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
426 const QString &fileName,
427 const QString &fileEncoding,
428 const QgsCoordinateTransform &ct,
429 const QString &driverName = "GPKG",
430 bool onlySelected = false,
431 QString *errorMessage SIP_OUT = nullptr,
432 const QStringList &datasourceOptions = QStringList(),
433 const QStringList &layerOptions = QStringList(),
434 bool skipAttributeCreation = false,
435 QString *newFilename = nullptr,
437 double symbologyScale = 1.0,
438 const QgsRectangle *filterExtent = nullptr,
439 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown,
440 bool forceMulti = false,
441 bool includeZ = false,
442 const QgsAttributeList &attributes = QgsAttributeList(),
443 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
444#ifndef SIP_RUN
445 , QString *newLayer = nullptr );
446#else
448#endif
449
454 class CORE_EXPORT SaveVectorOptions
455 {
456 public:
457
459
460 virtual ~SaveVectorOptions() = default;
461
463 QString driverName;
464
466 QString layerName;
467
469 QgsVectorFileWriter::ActionOnExistingFile actionOnExistingFile = CreateOrOverwriteFile;
470
473
479
481 bool onlySelectedFeatures = false;
482
484 QStringList datasourceOptions;
485
487 QStringList layerOptions;
488
490 bool skipAttributeCreation = false;
491
494
497
500
502 double symbologyScale = 1.0;
503
506
511 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown;
512
514 bool forceMulti = false;
515
517 bool includeZ = false;
518
525 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr;
526
528 QgsFeedback *feedback = nullptr;
529
536
543 bool saveMetadata = false;
544
552
560 bool includeConstraints = false;
561
570 bool setFieldDomains = true;
571
580 const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection = nullptr;
581 };
582
583#ifndef SIP_RUN
584
596#else
597
608#endif
609 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
610 const QString &fileName,
612 QString *newFilename = nullptr,
613 QString *errorMessage SIP_OUT = nullptr
614#ifndef SIP_RUN
615 , QString *newLayer = nullptr );
616#else
618#endif
619
624 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
625 const QString &fileEncoding,
626 const QgsFields &fields,
627 Qgis::WkbType geometryType,
629 const QString &driverName = "GPKG",
630 const QStringList &datasourceOptions = QStringList(),
631 const QStringList &layerOptions = QStringList(),
632 QString *newFilename = nullptr,
635#ifndef SIP_RUN
636 , QString *newLayer = nullptr,
638 FieldNameSource fieldNameSource = Original
639#endif
641
667 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
668 const QString &fileEncoding,
669 const QgsFields &fields,
670 Qgis::WkbType geometryType,
672 const QString &driverName,
673 const QStringList &datasourceOptions,
674 const QStringList &layerOptions,
675 QString *newFilename,
676 Qgis::FeatureSymbologyExport symbologyExport,
677 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
678 const QString &layerName,
680 QString *newLayer = nullptr,
683 FieldNameSource fieldNameSource = Original,
684 bool includeConstraints = false,
685 bool setFieldDomains = true,
686 const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection = nullptr
687 ) SIP_SKIP;
688
690 QgsVectorFileWriter &operator=( const QgsVectorFileWriter &rh ) = delete;
691
705 static QgsVectorFileWriter *create( const QString &fileName,
706 const QgsFields &fields,
707 Qgis::WkbType geometryType,
709 const QgsCoordinateTransformContext &transformContext,
712 QString *newFilename = nullptr,
713 QString *newLayer = nullptr ) SIP_FACTORY;
714
727 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( QgsVectorLayer *layer,
728 const QString &fileName,
729 const QgsCoordinateTransformContext &transformContext,
731 QString *newFilename = nullptr,
732 QString *newLayer = nullptr,
733 QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
734
747 static QgsVectorFileWriter::WriterError writeAsVectorFormatV3( QgsVectorLayer *layer,
748 const QString &fileName,
749 const QgsCoordinateTransformContext &transformContext,
751 QString *errorMessage SIP_OUT = nullptr,
752 QString *newFilename SIP_OUT = nullptr,
753 QString *newLayer SIP_OUT = nullptr );
754
759 {
761 QString driverName;
762
765
770 QStringList globs;
771 };
772
781 static QList< QgsVectorFileWriter::FilterFormatDetails > supportedFiltersAndFormats( VectorFormatOptions options = SortRecommended );
782
791 static QStringList supportedFormatExtensions( VectorFormatOptions options = SortRecommended );
792
799 static bool supportsFeatureStyles( const QString &driverName );
800
805 {
807 QString longName;
808
810 QString driverName;
811 };
812
824 static QList< QgsVectorFileWriter::DriverDetails > ogrDriverList( VectorFormatOptions options = SortRecommended );
825
831 static QString driverForExtension( const QString &extension );
832
839 static QString fileFilterString( VectorFormatOptions options = SortRecommended );
840
842 static QString filterForDriver( const QString &driverName );
843
845 static QString convertCodecNameForEncodingOption( const QString &codecName );
846
848 QgsVectorFileWriter::WriterError hasError() const;
849
851 QString errorMessage() const;
852
859 QString driver() const;
860
867 QString driverLongName() const;
868
874 Qgis::VectorFileWriterCapabilities capabilities() const;
875
876 bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
877 bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
878 QString lastError() const override;
879
883 bool addFeatureWithStyle( QgsFeature &feature, QgsFeatureRenderer *renderer, Qgis::DistanceUnit outputUnit = Qgis::DistanceUnit::Meters );
884
886 QMap<int, int> attrIdxToOgrIdx() const SIP_SKIP { return mAttrIdxToOgrIdx; }
887
889 ~QgsVectorFileWriter() override;
890
896 static bool deleteShapeFile( const QString &fileName );
897
903 Qgis::FeatureSymbologyExport symbologyExport() const { return mSymbologyExport; }
904
910 void setSymbologyExport( Qgis::FeatureSymbologyExport symExport ) { mSymbologyExport = symExport; }
911
917 double symbologyScale() const { return mSymbologyScale; }
918
924 void setSymbologyScale( double scale );
925
926 static bool driverMetadata( const QString &driverName, MetaData &driverMetadata );
927
933 static QStringList defaultDatasetOptions( const QString &driverName );
934
940 static QStringList defaultLayerOptions( const QString &driverName );
941
948 static OGRwkbGeometryType ogrTypeFromWkbType( Qgis::WkbType type ) SIP_SKIP;
949
953 static QgsVectorFileWriter::EditionCapabilities editionCapabilities( const QString &datasetName );
954
958 static bool targetLayerExists( const QString &datasetName,
959 const QString &layerName );
960
964 static bool areThereNewFieldsToCreate( const QString &datasetName,
965 const QString &layerName,
966 QgsVectorLayer *layer,
967 const QgsAttributeList &attributes );
968
969 protected:
971 OGRGeometryH createEmptyGeometry( Qgis::WkbType wkbType ) SIP_SKIP;
972
974 OGRLayerH mLayer = nullptr;
975 OGRSpatialReferenceH mOgrRef = nullptr;
976
978
982
983 QTextCodec *mCodec = nullptr;
984
987
989 QMap<int, int> mAttrIdxToOgrIdx;
990
992
993 QMap< QgsSymbolLayer *, QString > mSymbolLayerTable;
994
997
1000
1002 FieldValueConverter *mFieldValueConverter = nullptr;
1003
1005 bool mIncludeConstraints = false;
1006
1008 bool mSetFieldDomains = true;
1009
1010 private:
1011#ifdef SIP_RUN
1013#endif
1014
1015 struct PreparedWriterDetails
1016 {
1017 std::unique_ptr< QgsFeatureRenderer > renderer;
1019 Qgis::WkbType sourceWkbType = Qgis::WkbType::Unknown;
1020 QgsFields sourceFields;
1021 QString providerType;
1022 long long featureCount = 0;
1023 QgsFeatureIds selectedFeatureIds;
1024 QString dataSourceUri;
1025 QString storageType;
1026 QgsFeatureIterator geometryTypeScanIterator;
1027 QgsExpressionContext expressionContext;
1028 QSet< int > fieldsToConvertToInt;
1029 QgsRenderContext renderContext;
1030 bool shallTransform = false;
1033 QgsAttributeList attributes;
1034 QgsFields outputFields;
1035 QgsFeatureIterator sourceFeatureIterator;
1036 QgsGeometry filterRectGeometry;
1037 std::unique_ptr< QgsGeometryEngine > filterRectEngine;
1038 QVariantMap providerUriParams;
1039 std::unique_ptr< QgsAbstractDatabaseProviderConnection > sourceDatabaseProviderConnection;
1040 };
1041
1046 static QgsVectorFileWriter::WriterError prepareWriteAsVectorFormat( QgsVectorLayer *layer,
1048 PreparedWriterDetails &details );
1049
1064 static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( PreparedWriterDetails &details,
1065 const QString &fileName,
1066 const QgsCoordinateTransformContext &transformContext,
1068 QString *newFilename = nullptr,
1069 QString *newLayer = nullptr,
1070 QString *errorMessage SIP_OUT = nullptr,
1072
1078 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( PreparedWriterDetails &details,
1079 const QString &fileName,
1081 QString *newFilename = nullptr,
1082 QString *errorMessage SIP_OUT = nullptr,
1083 QString *newLayer = nullptr ) SIP_DEPRECATED;
1084
1085 void init( QString vectorFileName, QString fileEncoding, const QgsFields &fields,
1086 Qgis::WkbType geometryType, QgsCoordinateReferenceSystem srs,
1087 const QString &driverName, QStringList datasourceOptions,
1088 QStringList layerOptions, QString *newFilename,
1089 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
1090 const QString &layerName,
1091 QgsVectorFileWriter::ActionOnExistingFile action, QString *newLayer, QgsFeatureSink::SinkFlags sinkFlags,
1092 const QgsCoordinateTransformContext &transformContext,
1093 FieldNameSource fieldNameSource,
1094 const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection );
1095 void resetMap( const QgsAttributeList &attributes );
1096
1097 std::unique_ptr< QgsFeatureRenderer > mRenderer;
1098 QgsRenderContext mRenderContext;
1099
1100
1101 std::unique_ptr< QgsCoordinateTransform > mCoordinateTransform;
1102
1103 bool mUsingTransaction = false;
1104 QSet< QMetaType::Type > mSupportedListSubTypes;
1105
1106 Qgis::VectorFileWriterCapabilities mCapabilities;
1107
1108 void createSymbolLayerTable( QgsVectorLayer *vl, const QgsCoordinateTransform &ct, OGRDataSourceH ds );
1109 gdal::ogr_feature_unique_ptr createFeature( const QgsFeature &feature );
1110 bool writeFeature( OGRLayerH layer, OGRFeatureH feature );
1111
1113 QgsVectorFileWriter::WriterError exportFeaturesSymbolLevels( const PreparedWriterDetails &details, QgsFeatureIterator &fit, const QgsCoordinateTransform &ct, QString *errorMessage = nullptr );
1114 double mmScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1115 double mapUnitScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1116
1117 void startRender( QgsFeatureRenderer *sourceRenderer, const QgsFields &fields );
1118 void stopRender();
1119 std::unique_ptr< QgsFeatureRenderer > createSymbologyRenderer( QgsFeatureRenderer *sourceRenderer ) const;
1121 static void addRendererAttributes( QgsFeatureRenderer *renderer, QgsRenderContext &context, const QgsFields &fields, QgsAttributeList &attList );
1122
1124 static QStringList concatenateOptions( const QMap<QString, Option *> &options );
1125
1127 friend class TestQgsVectorFileWriter;
1128};
1129
1132
1133// clazy:excludeall=qstring-allocations
1134
1135#endif
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:54
DistanceUnit
Units of distance.
Definition qgis.h:4843
QFlags< VectorFileWriterCapability > VectorFileWriterCapabilities
Capabilities supported by a QgsVectorFileWriter object.
Definition qgis.h:1047
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:5337
@ NoSymbology
Export only data.
Provides common functionality for database based connections.
Represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Handles coordinate transforms between two 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.
Abstract base class for symbol layers.
QgsTask task which performs a QgsVectorFileWriter layer saving operation as a background task.
An available option for configuring file writing for a particular output format, presenting an boolea...
BoolOption(const QString &docString, bool defaultValue)
Interface to convert raw field values to their user-friendly values.
A hidden option for file writing for a particular output format.
An available option for configuring file writing for a particular output format, presenting an intege...
IntOption(const QString &docString, int defaultValue)
Describes an available option for configuring file writing for a particular output format.
Option(const QString &docString, QgsVectorFileWriter::OptionType type)
QgsVectorFileWriter::OptionType type
virtual ~Option()=default
Options to pass to QgsVectorFileWriter::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.
An available option for configuring file writing for a particular output format, presenting a choice ...
SetOption(const QString &docString, const QStringList &values, const QString &defaultValue, bool allowNone=false)
An available option for configuring file writing for a particular output format, presenting a freefor...
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...
@ Original
Use original field names.
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 dataset.
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
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,...