QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgsvectorfilewriter.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectorfilewriter.h
3 generic vector file writer
4 -------------------
5 begin : Jun 6 2004
6 copyright : (C) 2004 by Tim Sutton
7 email : tim at linfiniti.com
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19#ifndef QGSVECTORFILEWRITER_H
20#define QGSVECTORFILEWRITER_H
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
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
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
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
557 bool includeConstraints = false;
558 };
559
560#ifndef SIP_RUN
561
573#else
574
585#endif
586 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
587 const QString &fileName,
589 QString *newFilename = nullptr,
590 QString *errorMessage SIP_OUT = nullptr
591#ifndef SIP_RUN
592 , QString *newLayer = nullptr );
593#else
595#endif
596
601 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
602 const QString &fileEncoding,
603 const QgsFields &fields,
604 Qgis::WkbType geometryType,
606 const QString &driverName = "GPKG",
607 const QStringList &datasourceOptions = QStringList(),
608 const QStringList &layerOptions = QStringList(),
609 QString *newFilename = nullptr,
611 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags()
612#ifndef SIP_RUN
613 , QString *newLayer = nullptr,
615 FieldNameSource fieldNameSource = Original
616#endif
618
642 Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
643 const QString &fileEncoding,
644 const QgsFields &fields,
645 Qgis::WkbType geometryType,
647 const QString &driverName,
648 const QStringList &datasourceOptions,
649 const QStringList &layerOptions,
650 QString *newFilename,
651 Qgis::FeatureSymbologyExport symbologyExport,
652 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
653 const QString &layerName,
655 QString *newLayer = nullptr,
657 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
658 FieldNameSource fieldNameSource = Original,
659 bool includeConstraints = false
660 ) SIP_SKIP;
661
665 QgsVectorFileWriter &operator=( const QgsVectorFileWriter &rh ) = delete;
666
680 static QgsVectorFileWriter *create( const QString &fileName,
681 const QgsFields &fields,
682 Qgis::WkbType geometryType,
684 const QgsCoordinateTransformContext &transformContext,
686 QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
687 QString *newFilename = nullptr,
688 QString *newLayer = nullptr ) SIP_FACTORY;
689
702 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( QgsVectorLayer *layer,
703 const QString &fileName,
704 const QgsCoordinateTransformContext &transformContext,
706 QString *newFilename = nullptr,
707 QString *newLayer = nullptr,
708 QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
709
722 static QgsVectorFileWriter::WriterError writeAsVectorFormatV3( QgsVectorLayer *layer,
723 const QString &fileName,
724 const QgsCoordinateTransformContext &transformContext,
726 QString *errorMessage SIP_OUT = nullptr,
727 QString *newFilename SIP_OUT = nullptr,
728 QString *newLayer SIP_OUT = nullptr );
729
735 {
737 QString driverName;
738
741
746 QStringList globs;
747 };
748
757 static QList< QgsVectorFileWriter::FilterFormatDetails > supportedFiltersAndFormats( VectorFormatOptions options = SortRecommended );
758
768 static QStringList supportedFormatExtensions( VectorFormatOptions options = SortRecommended );
769
777 static bool supportsFeatureStyles( const QString &driverName );
778
784 {
786 QString longName;
787
789 QString driverName;
790 };
791
803 static QList< QgsVectorFileWriter::DriverDetails > ogrDriverList( VectorFormatOptions options = SortRecommended );
804
811 static QString driverForExtension( const QString &extension );
812
819 static QString fileFilterString( VectorFormatOptions options = SortRecommended );
820
822 static QString filterForDriver( const QString &driverName );
823
825 static QString convertCodecNameForEncodingOption( const QString &codecName );
826
828 QgsVectorFileWriter::WriterError hasError() const;
829
831 QString errorMessage() const;
832
839 QString driver() const;
840
847 QString driverLongName() const;
848
854 Qgis::VectorFileWriterCapabilities capabilities() const;
855
856 bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
857 bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
858 QString lastError() const override;
859
864 bool addFeatureWithStyle( QgsFeature &feature, QgsFeatureRenderer *renderer, Qgis::DistanceUnit outputUnit = Qgis::DistanceUnit::Meters );
865
867 QMap<int, int> attrIdxToOgrIdx() const { return mAttrIdxToOgrIdx; } SIP_SKIP
868
870 ~QgsVectorFileWriter() override;
871
877 static bool deleteShapeFile( const QString &fileName );
878
884 Qgis::FeatureSymbologyExport symbologyExport() const { return mSymbologyExport; }
885
891 void setSymbologyExport( Qgis::FeatureSymbologyExport symExport ) { mSymbologyExport = symExport; }
892
899 double symbologyScale() const { return mSymbologyScale; }
900
907 void setSymbologyScale( double scale );
908
909 static bool driverMetadata( const QString &driverName, MetaData &driverMetadata );
910
917 static QStringList defaultDatasetOptions( const QString &driverName );
918
925 static QStringList defaultLayerOptions( const QString &driverName );
926
933 static OGRwkbGeometryType ogrTypeFromWkbType( Qgis::WkbType type ) SIP_SKIP;
934
939 static QgsVectorFileWriter::EditionCapabilities editionCapabilities( const QString &datasetName );
940
945 static bool targetLayerExists( const QString &datasetName,
946 const QString &layerName );
947
952 static bool areThereNewFieldsToCreate( const QString &datasetName,
953 const QString &layerName,
954 QgsVectorLayer *layer,
955 const QgsAttributeList &attributes );
956
957 protected:
959 OGRGeometryH createEmptyGeometry( Qgis::WkbType wkbType ) SIP_SKIP;
960
962 OGRLayerH mLayer = nullptr;
963 OGRSpatialReferenceH mOgrRef = nullptr;
964
966
970
971 QTextCodec *mCodec = nullptr;
972
975
977 QMap<int, int> mAttrIdxToOgrIdx;
978
980
981 QMap< QgsSymbolLayer *, QString > mSymbolLayerTable;
982
985
988
990 FieldValueConverter *mFieldValueConverter = nullptr;
991
993 bool mIncludeConstraints = false;
994
995 private:
996#ifdef SIP_RUN
998#endif
999
1000 struct PreparedWriterDetails
1001 {
1002 std::unique_ptr< QgsFeatureRenderer > renderer;
1004 Qgis::WkbType sourceWkbType = Qgis::WkbType::Unknown;
1005 QgsFields sourceFields;
1006 QString providerType;
1007 long long featureCount = 0;
1008 QgsFeatureIds selectedFeatureIds;
1009 QString dataSourceUri;
1010 QString storageType;
1011 QgsFeatureIterator geometryTypeScanIterator;
1012 QgsExpressionContext expressionContext;
1013 QSet< int > fieldsToConvertToInt;
1014 QgsRenderContext renderContext;
1015 bool shallTransform = false;
1018 QgsAttributeList attributes;
1019 QgsFields outputFields;
1020 QgsFeatureIterator sourceFeatureIterator;
1021 QgsGeometry filterRectGeometry;
1022 std::unique_ptr< QgsGeometryEngine > filterRectEngine;
1023 QVariantMap providerUriParams;
1024 };
1025
1030 static QgsVectorFileWriter::WriterError prepareWriteAsVectorFormat( QgsVectorLayer *layer,
1032 PreparedWriterDetails &details );
1033
1047 static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( PreparedWriterDetails &details,
1048 const QString &fileName,
1049 const QgsCoordinateTransformContext &transformContext,
1051 QString *newFilename = nullptr,
1052 QString *newLayer = nullptr,
1053 QString *errorMessage SIP_OUT = nullptr );
1054
1060 Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( PreparedWriterDetails &details,
1061 const QString &fileName,
1063 QString *newFilename = nullptr,
1064 QString *errorMessage SIP_OUT = nullptr,
1065 QString *newLayer = nullptr ) SIP_DEPRECATED;
1066
1067 void init( QString vectorFileName, QString fileEncoding, const QgsFields &fields,
1068 Qgis::WkbType geometryType, QgsCoordinateReferenceSystem srs,
1069 const QString &driverName, QStringList datasourceOptions,
1070 QStringList layerOptions, QString *newFilename,
1071 QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
1072 const QString &layerName,
1073 QgsVectorFileWriter::ActionOnExistingFile action, QString *newLayer, QgsFeatureSink::SinkFlags sinkFlags,
1074 const QgsCoordinateTransformContext &transformContext,
1075 FieldNameSource fieldNameSource );
1076 void resetMap( const QgsAttributeList &attributes );
1077
1078 std::unique_ptr< QgsFeatureRenderer > mRenderer;
1079 QgsRenderContext mRenderContext;
1080
1081
1082 std::unique_ptr< QgsCoordinateTransform > mCoordinateTransform;
1083
1084 bool mUsingTransaction = false;
1085 QSet< QVariant::Type > mSupportedListSubTypes;
1086
1087 Qgis::VectorFileWriterCapabilities mCapabilities;
1088
1089 void createSymbolLayerTable( QgsVectorLayer *vl, const QgsCoordinateTransform &ct, OGRDataSourceH ds );
1090 gdal::ogr_feature_unique_ptr createFeature( const QgsFeature &feature );
1091 bool writeFeature( OGRLayerH layer, OGRFeatureH feature );
1092
1094 QgsVectorFileWriter::WriterError exportFeaturesSymbolLevels( const PreparedWriterDetails &details, QgsFeatureIterator &fit, const QgsCoordinateTransform &ct, QString *errorMessage = nullptr );
1095 double mmScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1096 double mapUnitScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits );
1097
1098 void startRender( QgsFeatureRenderer *sourceRenderer, const QgsFields &fields );
1099 void stopRender();
1100 std::unique_ptr< QgsFeatureRenderer > createSymbologyRenderer( QgsFeatureRenderer *sourceRenderer ) const;
1102 static void addRendererAttributes( QgsFeatureRenderer *renderer, QgsRenderContext &context, const QgsFields &fields, QgsAttributeList &attList );
1103
1105 static QStringList concatenateOptions( const QMap<QString, Option *> &options );
1106
1108 friend class TestQgsVectorFileWriter;
1109};
1110
1113
1114// clazy:excludeall=qstring-allocations
1115
1116#endif
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
DistanceUnit
Units of distance.
Definition qgis.h:3496
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:182
@ Unknown
Unknown.
FeatureSymbologyExport
Options for exporting features considering their symbology.
Definition qgis.h:3849
@ 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.
A structured metadata store for a map layer.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
QgsTask task which performs a QgsVectorFileWriter layer saving operation as a background task.
BoolOption(const QString &docString, bool defaultValue)
Interface to convert raw field values to their user-friendly value.
FieldValueConverter()=default
Constructor.
IntOption(const QString &docString, int defaultValue)
Option(const QString &docString, QgsVectorFileWriter::OptionType type)
QgsVectorFileWriter::OptionType type
virtual ~Option()=default
Options to pass to writeAsVectorFormat()
QgsCoordinateTransform ct
Transform to reproject exported geometries with, or invalid transform for no transformation.
QStringList attributesExportNames
Attributes export names.
QgsLayerMetadata layerMetadata
Layer metadata to save for the exported vector file.
QString layerName
Layer name. If let empty, it will be derived from the filename.
QgsRectangle filterExtent
If not empty, only features intersecting the extent will be saved.
QStringList layerOptions
List of OGR layer creation options.
QgsAttributeList attributes
Attributes to export (empty means all unless skipAttributeCreation is set)
QStringList datasourceOptions
List of OGR data source creation options.
SetOption(const QString &docString, const QStringList &values, const QString &defaultValue, bool allowNone=false)
StringOption(const QString &docString, const QString &defaultValue=QString())
A convenience class for writing vector layers to disk based formats (e.g.
EditionCapability
Edition capability flags.
Qgis::WkbType mWkbType
Geometry type which is being used.
double mSymbologyScale
Scale for symbology export (e.g. for symbols units in map units)
QMap< int, int > attrIdxToOgrIdx() const
QMap< int, int > mAttrIdxToOgrIdx
Map attribute indizes to OGR field indexes.
@ Canceled
Writing was interrupted by manual cancellation.
@ ErrSavingMetadata
Metadata saving failed.
gdal::ogr_datasource_unique_ptr mDS
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< OGRDataSourceH >::type, OGRDataSourceDeleter > ogr_datasource_unique_ptr
Scoped OGR data source.
#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
QList< int > QgsAttributeList
Definition qgsfield.h:27
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)
const QgsCoordinateReferenceSystem & outputCrs
Details of available driver formats.
QString longName
Descriptive, user friendly name for the driver.
QString driverName
Unique driver name.
Details of available filters and formats.
QString filterString
Filter string for file picker dialogs.
QStringList globs
Matching glob patterns for format, e.g.
MetaData(const QString &longName, const QString &trLongName, const QString &glob, const QString &ext, const QMap< QString, QgsVectorFileWriter::Option * > &driverOptions, const QMap< QString, QgsVectorFileWriter::Option * > &layerOptions, const QString &compulsoryEncoding=QString())
MetaData()=default
Constructor for MetaData.
QMap< QString, QgsVectorFileWriter::Option * > driverOptions
QMap< QString, QgsVectorFileWriter::Option * > layerOptions
QString compulsoryEncoding
Some formats require a compulsory encoding, typically UTF-8. If no compulsory encoding,...