QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
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 "qgssymbol.h"
27 #include "qgstaskmanager.h"
28 #include "qgsogrutils.h"
29 #include "qgsrenderer.h"
30 #include "qgsgeometryengine.h"
31 #include "qgsfeaturesink.h"
32 #include <ogr_api.h>
33 
34 class QgsSymbolLayer;
35 class QTextCodec;
36 class QgsFeatureIterator;
37 
45 class CORE_EXPORT QgsVectorFileWriter : public QgsFeatureSink
46 {
47  public:
49  {
50  Set,
52  Int,
53  Hidden
54  };
55 
59  class Option
60  {
61  public:
62  Option( const QString &docString, QgsVectorFileWriter::OptionType type )
63  : docString( docString )
64  , type( type ) {}
65  virtual ~Option() = default;
66 
67  QString docString;
69  };
70 
75  {
76  public:
77  SetOption( const QString &docString, const QStringList &values, const QString &defaultValue, bool allowNone = false )
78  : Option( docString, Set )
79  , values( qgis::listToSet( values ) )
80  , defaultValue( defaultValue )
81  , allowNone( allowNone )
82  {}
83 
84  QSet<QString> values;
85  QString defaultValue;
86  bool allowNone;
87  };
88 
93  {
94  public:
95  StringOption( const QString &docString, const QString &defaultValue = QString() )
96  : Option( docString, String )
97  , defaultValue( defaultValue )
98  {}
99 
100  QString defaultValue;
101  };
102 
107  {
108  public:
109  IntOption( const QString &docString, int defaultValue )
110  : Option( docString, Int )
111  , defaultValue( defaultValue )
112  {}
113 
115  };
116 
121  {
122  public:
123  BoolOption( const QString &docString, bool defaultValue )
124  : SetOption( docString, QStringList() << QStringLiteral( "YES" ) << QStringLiteral( "NO" ), defaultValue ? "YES" : "NO" )
125  {}
126  };
127 
132  {
133  public:
134  explicit HiddenOption( const QString &value )
135  : Option( QString(), Hidden )
136  , mValue( value )
137  {}
138 
139  QString mValue;
140  };
141 
142  struct MetaData
143  {
145  MetaData() = default;
146 
147  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() )
148  : longName( longName )
149  , trLongName( trLongName )
150  , glob( glob )
151  , ext( ext )
152  , driverOptions( driverOptions )
153  , layerOptions( layerOptions )
154  , compulsoryEncoding( compulsoryEncoding )
155  {}
156 
157  QString longName;
158  QString trLongName;
159  QString glob;
160  QString ext;
161  QMap<QString, QgsVectorFileWriter::Option *> driverOptions;
162  QMap<QString, QgsVectorFileWriter::Option *> layerOptions;
165  };
166 
168  {
169  NoError = 0,
179  };
180 
182  {
183  NoSymbology = 0, //export only data
184  FeatureSymbology, //Keeps the number of features and export symbology per feature
185  SymbolLayerSymbology //Exports one feature per symbol layer (considering symbol levels)
186  };
187 
194  {
195  Original = 0,
197  };
198 
204  {
205  SortRecommended = 1 << 1,
206  SkipNonSpatialFormats = 1 << 2,
207  };
208  Q_DECLARE_FLAGS( VectorFormatOptions, VectorFormatOption )
209 
210 
215  class CORE_EXPORT FieldValueConverter
216  {
217  public:
219  FieldValueConverter() = default;
220 
221  virtual ~FieldValueConverter() = default;
222 
228  virtual QgsField fieldDefinition( const QgsField &field );
229 
236  virtual QVariant convert( int fieldIdxInLayer, const QVariant &value );
237 
242  };
243 
249  {
251  CanAddNewLayer = 1 << 0,
252 
254  CanAppendToExistingLayer = 1 << 1,
255 
257  CanAddNewFieldsToExistingLayer = 1 << 2,
258 
260  CanDeleteLayer = 1 << 3
261  };
262 
267  Q_DECLARE_FLAGS( EditionCapabilities, EditionCapability )
268 
269 
274  {
277 
280 
283 
285  AppendToLayerAddFields
286  };
287 
288 #ifndef SIP_RUN
289 
315 #else
316 
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  QgsWkbTypes::Type overrideGeometryType = QgsWkbTypes::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
364  ) SIP_DEPRECATED;
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  QgsWkbTypes::Type overrideGeometryType = QgsWkbTypes::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
447  ) SIP_DEPRECATED;
448 #endif
449 
455  class CORE_EXPORT SaveVectorOptions
456  {
457  public:
460 
461  virtual ~SaveVectorOptions() = default;
462 
464  QString driverName;
465 
467  QString layerName;
468 
470  QgsVectorFileWriter::ActionOnExistingFile actionOnExistingFile = CreateOrOverwriteFile;
471 
473  QString fileEncoding;
474 
480 
482  bool onlySelectedFeatures = false;
483 
485  QStringList datasourceOptions;
486 
488  QStringList layerOptions;
489 
491  bool skipAttributeCreation = false;
492 
495 
497  QgsVectorFileWriter::SymbologyExport symbologyExport = NoSymbology;
498 
500  double symbologyScale = 1.0;
501 
504 
509  QgsWkbTypes::Type overrideGeometryType = QgsWkbTypes::Unknown;
510 
512  bool forceMulti = false;
513 
515  bool includeZ = false;
516 
523  QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr;
524 
526  QgsFeedback *feedback = nullptr;
527 
533  FieldNameSource fieldNameSource = Original;
534  };
535 
536 #ifndef SIP_RUN
537 
549 #else
550 
561 #endif
562  Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
563  const QString &fileName,
565  QString *newFilename = nullptr,
566  QString *errorMessage SIP_OUT = nullptr
567 #ifndef SIP_RUN
568  , QString *newLayer = nullptr );
569 #else
570  ) SIP_DEPRECATED;
571 #endif
572 
577  Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
578  const QString &fileEncoding,
579  const QgsFields &fields,
580  QgsWkbTypes::Type geometryType,
582  const QString &driverName = "GPKG",
583  const QStringList &datasourceOptions = QStringList(),
584  const QStringList &layerOptions = QStringList(),
585  QString *newFilename = nullptr,
587  QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags()
588 #ifndef SIP_RUN
589  , QString *newLayer = nullptr,
591  FieldNameSource fieldNameSource = Original
592 #endif
593  ) SIP_DEPRECATED;
594 
617  Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
618  const QString &fileEncoding,
619  const QgsFields &fields,
620  QgsWkbTypes::Type geometryType,
621  const QgsCoordinateReferenceSystem &srs,
622  const QString &driverName,
623  const QStringList &datasourceOptions,
624  const QStringList &layerOptions,
625  QString *newFilename,
626  QgsVectorFileWriter::SymbologyExport symbologyExport,
627  QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
628  const QString &layerName,
630  QString *newLayer = nullptr,
632  QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
633  FieldNameSource fieldNameSource = Original
634  ) SIP_SKIP;
635 
640 
654  static QgsVectorFileWriter *create( const QString &fileName,
655  const QgsFields &fields,
656  QgsWkbTypes::Type geometryType,
657  const QgsCoordinateReferenceSystem &srs,
658  const QgsCoordinateTransformContext &transformContext,
660  QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
661  QString *newFilename = nullptr,
662  QString *newLayer = nullptr ) SIP_FACTORY;
663 
676  static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( QgsVectorLayer *layer,
677  const QString &fileName,
678  const QgsCoordinateTransformContext &transformContext,
679  const QgsVectorFileWriter::SaveVectorOptions &options,
680  QString *newFilename = nullptr,
681  QString *newLayer = nullptr,
682  QString *errorMessage SIP_OUT = nullptr );
683 
689  {
691  QString driverName;
692 
694  QString filterString;
695 
700  QStringList globs;
701  };
702 
711  static QList< QgsVectorFileWriter::FilterFormatDetails > supportedFiltersAndFormats( VectorFormatOptions options = SortRecommended );
712 
722  static QStringList supportedFormatExtensions( VectorFormatOptions options = SortRecommended );
723 
731  static bool supportsFeatureStyles( const QString &driverName );
732 
738  {
740  QString longName;
741 
743  QString driverName;
744  };
745 
757  static QList< QgsVectorFileWriter::DriverDetails > ogrDriverList( VectorFormatOptions options = SortRecommended );
758 
765  static QString driverForExtension( const QString &extension );
766 
773  static QString fileFilterString( VectorFormatOptions options = SortRecommended );
774 
776  static QString filterForDriver( const QString &driverName );
777 
779  static QString convertCodecNameForEncodingOption( const QString &codecName );
780 
783 
785  QString errorMessage();
786 
787  bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
788  bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
789  QString lastError() const override;
790 
795  bool addFeatureWithStyle( QgsFeature &feature, QgsFeatureRenderer *renderer, QgsUnitTypes::DistanceUnit outputUnit = QgsUnitTypes::DistanceMeters );
796 
798  QMap<int, int> attrIdxToOgrIdx() { return mAttrIdxToOgrIdx; } SIP_SKIP
799 
801  ~QgsVectorFileWriter() override;
802 
808  static bool deleteShapeFile( const QString &fileName );
809 
810  QgsVectorFileWriter::SymbologyExport symbologyExport() const { return mSymbologyExport; }
811  void setSymbologyExport( QgsVectorFileWriter::SymbologyExport symExport ) { mSymbologyExport = symExport; }
812 
819  double symbologyScale() const { return mSymbologyScale; }
820 
827  void setSymbologyScale( double scale );
828 
829  static bool driverMetadata( const QString &driverName, MetaData &driverMetadata );
830 
837  static QStringList defaultDatasetOptions( const QString &driverName );
838 
845  static QStringList defaultLayerOptions( const QString &driverName );
846 
853  static OGRwkbGeometryType ogrTypeFromWkbType( QgsWkbTypes::Type type ) SIP_SKIP;
854 
859  static QgsVectorFileWriter::EditionCapabilities editionCapabilities( const QString &datasetName );
860 
865  static bool targetLayerExists( const QString &datasetName,
866  const QString &layerName );
867 
872  static bool areThereNewFieldsToCreate( const QString &datasetName,
873  const QString &layerName,
874  QgsVectorLayer *layer,
875  const QgsAttributeList &attributes );
876 
877  protected:
879  OGRGeometryH createEmptyGeometry( QgsWkbTypes::Type wkbType ) SIP_SKIP;
880 
882  OGRLayerH mLayer = nullptr;
883  OGRSpatialReferenceH mOgrRef = nullptr;
884 
886 
889  QString mErrorMessage;
890 
891  QTextCodec *mCodec = nullptr;
892 
895 
897  QMap<int, int> mAttrIdxToOgrIdx;
898 
900 
901  QMap< QgsSymbolLayer *, QString > mSymbolLayerTable;
902 
905 
906  QString mOgrDriverName;
907 
909  FieldValueConverter *mFieldValueConverter = nullptr;
910 
911  private:
912 #ifdef SIP_RUN
914 #endif
915 
916  struct PreparedWriterDetails
917  {
918  std::unique_ptr< QgsFeatureRenderer > renderer;
920  QgsWkbTypes::Type sourceWkbType = QgsWkbTypes::Unknown;
921  QgsFields sourceFields;
922  QString providerType;
923  long featureCount = 0;
924  QgsFeatureIds selectedFeatureIds;
925  QString dataSourceUri;
926  QString storageType;
927  QgsFeatureIterator geometryTypeScanIterator;
928  QgsExpressionContext expressionContext;
929  QSet< int > fieldsToConvertToInt;
930  QgsRenderContext renderContext;
931  bool shallTransform = false;
934  QgsAttributeList attributes;
935  QgsFields outputFields;
936  QgsFeatureIterator sourceFeatureIterator;
937  QgsGeometry filterRectGeometry;
938  std::unique_ptr< QgsGeometryEngine > filterRectEngine;
939  QVariantMap providerUriParams;
940  };
941 
946  static QgsVectorFileWriter::WriterError prepareWriteAsVectorFormat( QgsVectorLayer *layer,
948  PreparedWriterDetails &details );
949 
963  static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( PreparedWriterDetails &details,
964  const QString &fileName,
965  const QgsCoordinateTransformContext &transformContext,
967  QString *newFilename = nullptr,
968  QString *newLayer = nullptr,
969  QString *errorMessage SIP_OUT = nullptr );
970 
976  Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( PreparedWriterDetails &details,
977  const QString &fileName,
979  QString *newFilename = nullptr,
980  QString *errorMessage SIP_OUT = nullptr,
981  QString *newLayer = nullptr ) SIP_DEPRECATED;
982 
983  void init( QString vectorFileName, QString fileEncoding, const QgsFields &fields,
984  QgsWkbTypes::Type geometryType, QgsCoordinateReferenceSystem srs,
985  const QString &driverName, QStringList datasourceOptions,
986  QStringList layerOptions, QString *newFilename,
987  QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
988  const QString &layerName,
989  QgsVectorFileWriter::ActionOnExistingFile action, QString *newLayer, QgsFeatureSink::SinkFlags sinkFlags,
990  const QgsCoordinateTransformContext &transformContext,
991  FieldNameSource fieldNameSource );
992  void resetMap( const QgsAttributeList &attributes );
993 
994  std::unique_ptr< QgsFeatureRenderer > mRenderer;
995  QgsRenderContext mRenderContext;
996 
997 
998  std::unique_ptr< QgsCoordinateTransform > mCoordinateTransform;
999 
1000  bool mUsingTransaction = false;
1001  bool supportsStringList = false;
1002 
1003  void createSymbolLayerTable( QgsVectorLayer *vl, const QgsCoordinateTransform &ct, OGRDataSourceH ds );
1004  gdal::ogr_feature_unique_ptr createFeature( const QgsFeature &feature );
1005  bool writeFeature( OGRLayerH layer, OGRFeatureH feature );
1006 
1008  QgsVectorFileWriter::WriterError exportFeaturesSymbolLevels( const PreparedWriterDetails &details, QgsFeatureIterator &fit, const QgsCoordinateTransform &ct, QString *errorMessage = nullptr );
1009  double mmScaleFactor( double scale, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits );
1010  double mapUnitScaleFactor( double scale, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits );
1011 
1012  void startRender( QgsFeatureRenderer *sourceRenderer, const QgsFields &fields );
1013  void stopRender();
1014  std::unique_ptr< QgsFeatureRenderer > createSymbologyRenderer( QgsFeatureRenderer *sourceRenderer ) const;
1016  static void addRendererAttributes( QgsFeatureRenderer *renderer, QgsRenderContext &context, const QgsFields &fields, QgsAttributeList &attList );
1017 
1019  static QStringList concatenateOptions( const QMap<QString, Option *> &options );
1020 
1022  friend class TestQgsVectorFileWriter;
1023 };
1024 
1025 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsVectorFileWriter::EditionCapabilities )
1026 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsVectorFileWriter::VectorFormatOptions )
1027 
1028 // clazy:excludeall=qstring-allocations
1029 
1030 #endif
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 id, geometry and a list of field/values...
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:51
Container of fields for a vector layer.
Definition: qgsfields.h:45
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
A rectangle specified with double values.
Definition: qgsrectangle.h:42
Contains information about the context of a rendering operation.
Helper functions for various unit types.
Definition: qgsunittypes.h:39
DistanceUnit
Units of distance.
Definition: qgsunittypes.h:68
@ DistanceMeters
Meters.
Definition: qgsunittypes.h:69
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.
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 files to disk.
EditionCapability
Edition capability flags.
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.
gdal::ogr_datasource_unique_ptr mDS
QgsVectorFileWriter(const QgsVectorFileWriter &rh)=delete
QgsVectorFileWriter cannot be copied.
double symbologyScale() const
Returns the reference scale for output.
SymbologyExport mSymbologyExport
QgsWkbTypes::Type mWkbType
Geometry type which is being used.
VectorFormatOption
Options for sorting and filtering vector formats.
void setSymbologyExport(QgsVectorFileWriter::SymbologyExport symExport)
QMap< int, int > attrIdxToOgrIdx()
QgsVectorFileWriter & operator=(const QgsVectorFileWriter &rh)=delete
QgsVectorFileWriter cannot be copied.
WriterError mError
Contains error value if construction was not successful.
FieldNameSource
Source for exported field names.
@ PreferAlias
Use the field alias as the exported field name, wherever one is set. Otherwise use the original field...
QgsVectorFileWriter::SymbologyExport symbologyExport() const
QMap< QgsSymbolLayer *, QString > mSymbolLayerTable
ActionOnExistingFile
Combination of CanAddNewLayer, CanAppendToExistingLayer, CanAddNewFieldsToExistingLayer or CanDeleteL...
@ CreateOrOverwriteLayer
Create or overwrite layer.
@ CreateOrOverwriteFile
Create or overwrite file.
@ AppendToLayerNoNewFields
Append features to existing layer, but do not create new fields.
Represents a vector layer which manages a vector based data sets.
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:42
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:70
std::unique_ptr< std::remove_pointer< OGRFeatureH >::type, OGRFeatureDeleter > ogr_feature_unique_ptr
Scoped OGR feature.
Definition: qgsogrutils.h:129
std::unique_ptr< std::remove_pointer< OGRDataSourceH >::type, OGRDataSourceDeleter > ogr_datasource_unique_ptr
Scoped OGR data source.
Definition: qgsogrutils.h:114
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition: qgsgeos.h:79
#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:614
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:37
QList< int > QgsAttributeList
Definition: qgsfield.h:26
const QgsField & field
Definition: qgsfield.h:472
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,...