QGIS API Documentation 3.99.0-Master (798f63fc3c0)
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
511
516 Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown;
517
519 bool forceMulti = false;
520
522 bool includeZ = false;
523
530 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr;
531
533 QgsFeedback *feedback = nullptr;
534
541
548 bool saveMetadata = false;
549
557
565 bool includeConstraints = false;
566
575 bool setFieldDomains = true;
576
585 const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection = nullptr;
586 };
587
588#ifndef SIP_RUN
589
601#else
602
613#endif
614 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
615 const QString &fileName,
617 QString *newFilename = nullptr,
618 QString *errorMessage SIP_OUT = nullptr
619#ifndef SIP_RUN
620 , QString *newLayer = nullptr );
621#else
623#endif
624
629 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
630 const QString &fileEncoding,
631 const QgsFields &fields,
632 Qgis::WkbType geometryType,
634 const QString &driverName = "GPKG",
635 const QStringList &datasourceOptions = QStringList(),
636 const QStringList &layerOptions = QStringList(),
637 QString *newFilename = nullptr,
640#ifndef SIP_RUN
641 , QString *newLayer = nullptr,
643 FieldNameSource fieldNameSource = Original
644#endif
646
672 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
673 const QString &fileEncoding,
674 const QgsFields &fields,
675 Qgis::WkbType geometryType,
677 const QString &driverName,
678 const QStringList &datasourceOptions,
679 const QStringList &layerOptions,
680 QString *newFilename,
681 Qgis::FeatureSymbologyExport symbologyExport,
682 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
683 const QString &layerName,
685 QString *newLayer = nullptr,
688 FieldNameSource fieldNameSource = Original,
689 bool includeConstraints = false,
690 bool setFieldDomains = true,
691 const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection = nullptr
692 ) SIP_SKIP;
693
695 QgsVectorFileWriter &operator=( const QgsVectorFileWriter &rh ) = delete;
696
710 static QgsVectorFileWriter *create( const QString &fileName,
711 const QgsFields &fields,
712 Qgis::WkbType geometryType,
714 const QgsCoordinateTransformContext &transformContext,
717 QString *newFilename = nullptr,
718 QString *newLayer = nullptr ) SIP_FACTORY;
719
732 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( QgsVectorLayer *layer,
733 const QString &fileName,
734 const QgsCoordinateTransformContext &transformContext,
736 QString *newFilename = nullptr,
737 QString *newLayer = nullptr,
738 QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
739
752 static QgsVectorFileWriter::WriterError writeAsVectorFormatV3( QgsVectorLayer *layer,
753 const QString &fileName,
754 const QgsCoordinateTransformContext &transformContext,
756 QString *errorMessage SIP_OUT = nullptr,
757 QString *newFilename SIP_OUT = nullptr,
758 QString *newLayer SIP_OUT = nullptr );
759
764 {
766 QString driverName;
767
770
775 QStringList globs;
776 };
777
786 static QList< QgsVectorFileWriter::FilterFormatDetails > supportedFiltersAndFormats( VectorFormatOptions options = SortRecommended );
787
796 static QStringList supportedFormatExtensions( VectorFormatOptions options = SortRecommended );
797
804 static bool supportsFeatureStyles( const QString &driverName );
805
810 {
812 QString longName;
813
815 QString driverName;
816 };
817
829 static QList< QgsVectorFileWriter::DriverDetails > ogrDriverList( VectorFormatOptions options = SortRecommended );
830
836 static QString driverForExtension( const QString &extension );
837
844 static QString fileFilterString( VectorFormatOptions options = SortRecommended );
845
847 static QString filterForDriver( const QString &driverName );
848
850 static QString convertCodecNameForEncodingOption( const QString &codecName );
851
853 QgsVectorFileWriter::WriterError hasError() const;
854
856 QString errorMessage() const;
857
864 QString driver() const;
865
872 QString driverLongName() const;
873
879 Qgis::VectorFileWriterCapabilities capabilities() const;
880
881 bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
882 bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
883 QString lastError() const override;
884
888 bool addFeatureWithStyle( QgsFeature &feature, QgsFeatureRenderer *renderer, Qgis::DistanceUnit outputUnit = Qgis::DistanceUnit::Meters );
889
895 QMap<int, int> sourceFieldIndexToWriterFieldIndex() const { return mAttrIdxToOgrIdx; }
896
898 ~QgsVectorFileWriter() override;
899
905 static bool deleteShapeFile( const QString &fileName );
906
912 Qgis::FeatureSymbologyExport symbologyExport() const { return mSymbologyExport; }
913
919 void setSymbologyExport( Qgis::FeatureSymbologyExport symExport ) { mSymbologyExport = symExport; }
920
926 double symbologyScale() const { return mSymbologyScale; }
927
933 void setSymbologyScale( double scale );
934
935 static bool driverMetadata( const QString &driverName, MetaData &driverMetadata );
936
942 static QStringList defaultDatasetOptions( const QString &driverName );
943
949 static QStringList defaultLayerOptions( const QString &driverName );
950
957 static OGRwkbGeometryType ogrTypeFromWkbType( Qgis::WkbType type ) SIP_SKIP;
958
962 static QgsVectorFileWriter::EditionCapabilities editionCapabilities( const QString &datasetName );
963
967 static bool targetLayerExists( const QString &datasetName,
968 const QString &layerName );
969
973 static bool areThereNewFieldsToCreate( const QString &datasetName,
974 const QString &layerName,
975 QgsVectorLayer *layer,
976 const QgsAttributeList &attributes );
977
978 protected:
980 OGRGeometryH createEmptyGeometry( Qgis::WkbType wkbType ) SIP_SKIP;
981
983 OGRLayerH mLayer = nullptr;
984 OGRSpatialReferenceH mOgrRef = nullptr;
985
987
991
992 QTextCodec *mCodec = nullptr;
993
996
998 QMap<int, int> mAttrIdxToOgrIdx;
999
1001
1002 QMap< QgsSymbolLayer *, QString > mSymbolLayerTable;
1003
1006
1009
1011 FieldValueConverter *mFieldValueConverter = nullptr;
1012
1014 bool mIncludeConstraints = false;
1015
1017 bool mSetFieldDomains = true;
1018
1019 private:
1020#ifdef SIP_RUN
1022#endif
1023
1024 struct PreparedWriterDetails
1025 {
1026 std::unique_ptr< QgsFeatureRenderer > renderer;
1028 Qgis::WkbType sourceWkbType = Qgis::WkbType::Unknown;
1029 QgsFields sourceFields;
1030 QString providerType;
1031 long long featureCount = 0;
1032 QgsFeatureIds selectedFeatureIds;
1033 QString dataSourceUri;
1034 QString storageType;
1035 QgsFeatureIterator geometryTypeScanIterator;
1036 QgsExpressionContext expressionContext;
1037 QSet< int > fieldsToConvertToInt;
1038 QgsRenderContext renderContext;
1039 bool shallTransform = false;
1042 QgsAttributeList attributes;
1043 QgsFields outputFields;
1044 QgsFeatureIterator sourceFeatureIterator;
1045 QgsGeometry filterRectGeometry;
1046 std::unique_ptr< QgsGeometryEngine > filterRectEngine;
1047 QVariantMap providerUriParams;
1048 std::unique_ptr< QgsAbstractDatabaseProviderConnection > sourceDatabaseProviderConnection;
1049 };
1050
1055 static QgsVectorFileWriter::WriterError prepareWriteAsVectorFormat( QgsVectorLayer *layer,
1057 PreparedWriterDetails &details );
1058
1073 static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( PreparedWriterDetails &details,
1074 const QString &fileName,
1075 const QgsCoordinateTransformContext &transformContext,
1077 QString *newFilename = nullptr,
1078 QString *newLayer = nullptr,
1079 QString *errorMessage SIP_OUT = nullptr,
1081
1087 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( PreparedWriterDetails &details,
1088 const QString &fileName,
1090 QString *newFilename = nullptr,
1091 QString *errorMessage SIP_OUT = nullptr,
1092 QString *newLayer = nullptr ) SIP_DEPRECATED;
1093
1094 void init( QString vectorFileName, QString fileEncoding, const QgsFields &fields,
1095 Qgis::WkbType geometryType, QgsCoordinateReferenceSystem srs,
1096 const QString &driverName, QStringList datasourceOptions,
1097 QStringList layerOptions, QString *newFilename,
1098 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
1099 const QString &layerName,
1100 QgsVectorFileWriter::ActionOnExistingFile action, QString *newLayer, QgsFeatureSink::SinkFlags sinkFlags,
1101 const QgsCoordinateTransformContext &transformContext,
1102 FieldNameSource fieldNameSource,
1103 const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection );
1104 void resetMap( const QgsAttributeList &attributes );
1105
1106 std::unique_ptr< QgsFeatureRenderer > mRenderer;
1107 QgsRenderContext mRenderContext;
1108
1109
1110 std::unique_ptr< QgsCoordinateTransform > mCoordinateTransform;
1111
1112 bool mUsingTransaction = false;
1113 QSet< QMetaType::Type > mSupportedListSubTypes;
1114
1115 Qgis::VectorFileWriterCapabilities mCapabilities;
1116
1117 void createSymbolLayerTable( QgsVectorLayer *vl, const QgsCoordinateTransform &ct, OGRDataSourceH ds );
1118 gdal::ogr_feature_unique_ptr createFeature( const QgsFeature &feature );
1119 bool writeFeature( OGRLayerH layer, OGRFeatureH feature );
1120
1122 QgsVectorFileWriter::WriterError exportFeaturesSymbolLevels( const PreparedWriterDetails &details, QgsFeatureIterator &fit, const QgsCoordinateTransform &ct, QString *errorMessage = nullptr );
1123 double mmScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1124 double mapUnitScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1125
1126 void startRender( QgsFeatureRenderer *sourceRenderer, const QgsFields &fields );
1127 void stopRender();
1128 std::unique_ptr< QgsFeatureRenderer > createSymbologyRenderer( QgsFeatureRenderer *sourceRenderer ) const;
1130 static void addRendererAttributes( QgsFeatureRenderer *renderer, QgsRenderContext &context, const QgsFields &fields, QgsAttributeList &attList );
1131
1133 static QStringList concatenateOptions( const QMap<QString, Option *> &options );
1134
1136 friend class TestQgsVectorFileWriter;
1137};
1138
1141
1142// clazy:excludeall=qstring-allocations
1143
1144#endif
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:54
DistanceUnit
Units of distance.
Definition qgis.h:4894
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:5423
@ 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 > 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
QMap< int, int > sourceFieldIndexToWriterFieldIndex() const
Returns the map of original source field index to output file field index.
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:114
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:286
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_OUT
Definition qgis_sip.h:58
#define SIP_FACTORY
Definition qgis_sip.h:84
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,...