QGIS API Documentation  3.23.0-Master (c716e02dd3)
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 "qgstaskmanager.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 
34 class QgsSymbolLayer;
35 class QTextCodec;
36 class QgsFeatureIterator;
37 
47 class CORE_EXPORT QgsVectorFileWriter : public QgsFeatureSink
48 {
49  public:
51  {
52  Set,
54  Int,
55  Hidden
56  };
57 
61  class Option
62  {
63  public:
64  Option( const QString &docString, QgsVectorFileWriter::OptionType type )
65  : docString( docString )
66  , type( type ) {}
67  virtual ~Option() = default;
68 
69  QString docString;
71  };
72 
77  {
78  public:
79  SetOption( const QString &docString, const QStringList &values, const QString &defaultValue, bool allowNone = false )
80  : Option( docString, Set )
81  , values( qgis::listToSet( values ) )
82  , defaultValue( defaultValue )
83  , allowNone( allowNone )
84  {}
85 
86  QSet<QString> values;
87  QString defaultValue;
88  bool allowNone;
89  };
90 
95  {
96  public:
97  StringOption( const QString &docString, const QString &defaultValue = QString() )
98  : Option( docString, String )
99  , defaultValue( defaultValue )
100  {}
101 
102  QString defaultValue;
103  };
104 
109  {
110  public:
111  IntOption( const QString &docString, int defaultValue )
112  : Option( docString, Int )
113  , defaultValue( defaultValue )
114  {}
115 
117  };
118 
123  {
124  public:
125  BoolOption( const QString &docString, bool defaultValue )
126  : SetOption( docString, QStringList() << QStringLiteral( "YES" ) << QStringLiteral( "NO" ), defaultValue ? "YES" : "NO" )
127  {}
128  };
129 
134  {
135  public:
136  explicit HiddenOption( const QString &value )
137  : Option( QString(), Hidden )
138  , mValue( value )
139  {}
140 
141  QString mValue;
142  };
143 
144  struct MetaData
145  {
147  MetaData() = default;
148 
149  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() )
150  : longName( longName )
151  , trLongName( trLongName )
152  , glob( glob )
153  , ext( ext )
154  , driverOptions( driverOptions )
155  , layerOptions( layerOptions )
156  , compulsoryEncoding( compulsoryEncoding )
157  {}
158 
159  QString longName;
160  QString trLongName;
161  QString glob;
162  QString ext;
163  QMap<QString, QgsVectorFileWriter::Option *> driverOptions;
164  QMap<QString, QgsVectorFileWriter::Option *> layerOptions;
167  };
168 
170  {
171  NoError = 0,
182  };
183 
185  {
186  NoSymbology = 0, //export only data
187  FeatureSymbology, //Keeps the number of features and export symbology per feature
188  SymbolLayerSymbology //Exports one feature per symbol layer (considering symbol levels)
189  };
190 
197  {
198  Original = 0,
200  };
201 
207  {
208  SortRecommended = 1 << 1,
209  SkipNonSpatialFormats = 1 << 2,
210  };
211  Q_DECLARE_FLAGS( VectorFormatOptions, VectorFormatOption )
212 
213 
218  class CORE_EXPORT FieldValueConverter
219  {
220  public:
222  FieldValueConverter() = default;
223 
224  virtual ~FieldValueConverter() = default;
225 
231  virtual QgsField fieldDefinition( const QgsField &field );
232 
239  virtual QVariant convert( int fieldIdxInLayer, const QVariant &value );
240 
245  };
246 
252  {
254  CanAddNewLayer = 1 << 0,
255 
257  CanAppendToExistingLayer = 1 << 1,
258 
260  CanAddNewFieldsToExistingLayer = 1 << 2,
261 
263  CanDeleteLayer = 1 << 3
264  };
265 
270  Q_DECLARE_FLAGS( EditionCapabilities, EditionCapability )
271 
272 
277  {
280 
283 
286 
288  AppendToLayerAddFields
289  };
290 
291 #ifndef SIP_RUN
292 
318 #else
319 
344 #endif
345  Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
346  const QString &fileName,
347  const QString &fileEncoding,
349  const QString &driverName = "GPKG",
350  bool onlySelected = false,
351  QString *errorMessage SIP_OUT = nullptr,
352  const QStringList &datasourceOptions = QStringList(),
353  const QStringList &layerOptions = QStringList(),
354  bool skipAttributeCreation = false,
355  QString *newFilename = nullptr,
357  double symbologyScale = 1.0,
358  const QgsRectangle *filterExtent = nullptr,
359  QgsWkbTypes::Type overrideGeometryType = QgsWkbTypes::Unknown,
360  bool forceMulti = false,
361  bool includeZ = false,
362  const QgsAttributeList &attributes = QgsAttributeList(),
363  QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
364 #ifndef SIP_RUN
365  , QString *newLayer = nullptr );
366 #else
367  ) SIP_DEPRECATED;
368 #endif
369 
370 #ifndef SIP_RUN
371 
399 #else
400 
427 #endif
428  Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
429  const QString &fileName,
430  const QString &fileEncoding,
431  const QgsCoordinateTransform &ct,
432  const QString &driverName = "GPKG",
433  bool onlySelected = false,
434  QString *errorMessage SIP_OUT = nullptr,
435  const QStringList &datasourceOptions = QStringList(),
436  const QStringList &layerOptions = QStringList(),
437  bool skipAttributeCreation = false,
438  QString *newFilename = nullptr,
440  double symbologyScale = 1.0,
441  const QgsRectangle *filterExtent = nullptr,
442  QgsWkbTypes::Type overrideGeometryType = QgsWkbTypes::Unknown,
443  bool forceMulti = false,
444  bool includeZ = false,
445  const QgsAttributeList &attributes = QgsAttributeList(),
446  QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr
447 #ifndef SIP_RUN
448  , QString *newLayer = nullptr );
449 #else
450  ) SIP_DEPRECATED;
451 #endif
452 
458  class CORE_EXPORT SaveVectorOptions
459  {
460  public:
463 
464  virtual ~SaveVectorOptions() = default;
465 
467  QString driverName;
468 
470  QString layerName;
471 
473  QgsVectorFileWriter::ActionOnExistingFile actionOnExistingFile = CreateOrOverwriteFile;
474 
476  QString fileEncoding;
477 
483 
485  bool onlySelectedFeatures = false;
486 
488  QStringList datasourceOptions;
489 
491  QStringList layerOptions;
492 
494  bool skipAttributeCreation = false;
495 
498 
500  QgsVectorFileWriter::SymbologyExport symbologyExport = NoSymbology;
501 
503  double symbologyScale = 1.0;
504 
507 
512  QgsWkbTypes::Type overrideGeometryType = QgsWkbTypes::Unknown;
513 
515  bool forceMulti = false;
516 
518  bool includeZ = false;
519 
526  QgsVectorFileWriter::FieldValueConverter *fieldValueConverter = nullptr;
527 
529  QgsFeedback *feedback = nullptr;
530 
536  FieldNameSource fieldNameSource = Original;
537 
544  bool saveMetadata = false;
545 
553  };
554 
555 #ifndef SIP_RUN
556 
568 #else
569 
580 #endif
581  Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( QgsVectorLayer *layer,
582  const QString &fileName,
584  QString *newFilename = nullptr,
585  QString *errorMessage SIP_OUT = nullptr
586 #ifndef SIP_RUN
587  , QString *newLayer = nullptr );
588 #else
589  ) SIP_DEPRECATED;
590 #endif
591 
596  Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
597  const QString &fileEncoding,
598  const QgsFields &fields,
599  QgsWkbTypes::Type geometryType,
601  const QString &driverName = "GPKG",
602  const QStringList &datasourceOptions = QStringList(),
603  const QStringList &layerOptions = QStringList(),
604  QString *newFilename = nullptr,
606  QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags()
607 #ifndef SIP_RUN
608  , QString *newLayer = nullptr,
610  FieldNameSource fieldNameSource = Original
611 #endif
612  ) SIP_DEPRECATED;
613 
636  Q_DECL_DEPRECATED QgsVectorFileWriter( const QString &vectorFileName,
637  const QString &fileEncoding,
638  const QgsFields &fields,
639  QgsWkbTypes::Type geometryType,
640  const QgsCoordinateReferenceSystem &srs,
641  const QString &driverName,
642  const QStringList &datasourceOptions,
643  const QStringList &layerOptions,
644  QString *newFilename,
645  QgsVectorFileWriter::SymbologyExport symbologyExport,
646  QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
647  const QString &layerName,
649  QString *newLayer = nullptr,
651  QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
652  FieldNameSource fieldNameSource = Original
653  ) SIP_SKIP;
654 
659 
673  static QgsVectorFileWriter *create( const QString &fileName,
674  const QgsFields &fields,
675  QgsWkbTypes::Type geometryType,
676  const QgsCoordinateReferenceSystem &srs,
677  const QgsCoordinateTransformContext &transformContext,
679  QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
680  QString *newFilename = nullptr,
681  QString *newLayer = nullptr ) SIP_FACTORY;
682 
695  Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( QgsVectorLayer *layer,
696  const QString &fileName,
697  const QgsCoordinateTransformContext &transformContext,
698  const QgsVectorFileWriter::SaveVectorOptions &options,
699  QString *newFilename = nullptr,
700  QString *newLayer = nullptr,
701  QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
702 
715  static QgsVectorFileWriter::WriterError writeAsVectorFormatV3( QgsVectorLayer *layer,
716  const QString &fileName,
717  const QgsCoordinateTransformContext &transformContext,
718  const QgsVectorFileWriter::SaveVectorOptions &options,
719  QString *errorMessage SIP_OUT = nullptr,
720  QString *newFilename SIP_OUT = nullptr,
721  QString *newLayer SIP_OUT = nullptr );
722 
728  {
730  QString driverName;
731 
733  QString filterString;
734 
739  QStringList globs;
740  };
741 
750  static QList< QgsVectorFileWriter::FilterFormatDetails > supportedFiltersAndFormats( VectorFormatOptions options = SortRecommended );
751 
761  static QStringList supportedFormatExtensions( VectorFormatOptions options = SortRecommended );
762 
770  static bool supportsFeatureStyles( const QString &driverName );
771 
777  {
779  QString longName;
780 
782  QString driverName;
783  };
784 
796  static QList< QgsVectorFileWriter::DriverDetails > ogrDriverList( VectorFormatOptions options = SortRecommended );
797 
804  static QString driverForExtension( const QString &extension );
805 
812  static QString fileFilterString( VectorFormatOptions options = SortRecommended );
813 
815  static QString filterForDriver( const QString &driverName );
816 
818  static QString convertCodecNameForEncodingOption( const QString &codecName );
819 
822 
824  QString errorMessage();
825 
826  bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
827  bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) override;
828  QString lastError() const override;
829 
834  bool addFeatureWithStyle( QgsFeature &feature, QgsFeatureRenderer *renderer, QgsUnitTypes::DistanceUnit outputUnit = QgsUnitTypes::DistanceMeters );
835 
837  QMap<int, int> attrIdxToOgrIdx() { return mAttrIdxToOgrIdx; } SIP_SKIP
838 
840  ~QgsVectorFileWriter() override;
841 
847  static bool deleteShapeFile( const QString &fileName );
848 
849  QgsVectorFileWriter::SymbologyExport symbologyExport() const { return mSymbologyExport; }
850  void setSymbologyExport( QgsVectorFileWriter::SymbologyExport symExport ) { mSymbologyExport = symExport; }
851 
858  double symbologyScale() const { return mSymbologyScale; }
859 
866  void setSymbologyScale( double scale );
867 
868  static bool driverMetadata( const QString &driverName, MetaData &driverMetadata );
869 
876  static QStringList defaultDatasetOptions( const QString &driverName );
877 
884  static QStringList defaultLayerOptions( const QString &driverName );
885 
892  static OGRwkbGeometryType ogrTypeFromWkbType( QgsWkbTypes::Type type ) SIP_SKIP;
893 
898  static QgsVectorFileWriter::EditionCapabilities editionCapabilities( const QString &datasetName );
899 
904  static bool targetLayerExists( const QString &datasetName,
905  const QString &layerName );
906 
911  static bool areThereNewFieldsToCreate( const QString &datasetName,
912  const QString &layerName,
913  QgsVectorLayer *layer,
914  const QgsAttributeList &attributes );
915 
916  protected:
918  OGRGeometryH createEmptyGeometry( QgsWkbTypes::Type wkbType ) SIP_SKIP;
919 
921  OGRLayerH mLayer = nullptr;
922  OGRSpatialReferenceH mOgrRef = nullptr;
923 
925 
928  QString mErrorMessage;
929 
930  QTextCodec *mCodec = nullptr;
931 
934 
936  QMap<int, int> mAttrIdxToOgrIdx;
937 
939 
940  QMap< QgsSymbolLayer *, QString > mSymbolLayerTable;
941 
944 
945  QString mOgrDriverName;
946 
948  FieldValueConverter *mFieldValueConverter = nullptr;
949 
950  private:
951 #ifdef SIP_RUN
953 #endif
954 
955  struct PreparedWriterDetails
956  {
957  std::unique_ptr< QgsFeatureRenderer > renderer;
959  QgsWkbTypes::Type sourceWkbType = QgsWkbTypes::Unknown;
960  QgsFields sourceFields;
961  QString providerType;
962  long long featureCount = 0;
963  QgsFeatureIds selectedFeatureIds;
964  QString dataSourceUri;
965  QString storageType;
966  QgsFeatureIterator geometryTypeScanIterator;
967  QgsExpressionContext expressionContext;
968  QSet< int > fieldsToConvertToInt;
969  QgsRenderContext renderContext;
970  bool shallTransform = false;
973  QgsAttributeList attributes;
974  QgsFields outputFields;
975  QgsFeatureIterator sourceFeatureIterator;
976  QgsGeometry filterRectGeometry;
977  std::unique_ptr< QgsGeometryEngine > filterRectEngine;
978  QVariantMap providerUriParams;
979  };
980 
985  static QgsVectorFileWriter::WriterError prepareWriteAsVectorFormat( QgsVectorLayer *layer,
987  PreparedWriterDetails &details );
988 
1002  static QgsVectorFileWriter::WriterError writeAsVectorFormatV2( PreparedWriterDetails &details,
1003  const QString &fileName,
1004  const QgsCoordinateTransformContext &transformContext,
1006  QString *newFilename = nullptr,
1007  QString *newLayer = nullptr,
1008  QString *errorMessage SIP_OUT = nullptr );
1009 
1015  Q_DECL_DEPRECATED static QgsVectorFileWriter::WriterError writeAsVectorFormat( PreparedWriterDetails &details,
1016  const QString &fileName,
1018  QString *newFilename = nullptr,
1019  QString *errorMessage SIP_OUT = nullptr,
1020  QString *newLayer = nullptr ) SIP_DEPRECATED;
1021 
1022  void init( QString vectorFileName, QString fileEncoding, const QgsFields &fields,
1023  QgsWkbTypes::Type geometryType, QgsCoordinateReferenceSystem srs,
1024  const QString &driverName, QStringList datasourceOptions,
1025  QStringList layerOptions, QString *newFilename,
1026  QgsVectorFileWriter::FieldValueConverter *fieldValueConverter,
1027  const QString &layerName,
1028  QgsVectorFileWriter::ActionOnExistingFile action, QString *newLayer, QgsFeatureSink::SinkFlags sinkFlags,
1029  const QgsCoordinateTransformContext &transformContext,
1030  FieldNameSource fieldNameSource );
1031  void resetMap( const QgsAttributeList &attributes );
1032 
1033  std::unique_ptr< QgsFeatureRenderer > mRenderer;
1034  QgsRenderContext mRenderContext;
1035 
1036 
1037  std::unique_ptr< QgsCoordinateTransform > mCoordinateTransform;
1038 
1039  bool mUsingTransaction = false;
1040  QSet< QVariant::Type > mSupportedListSubTypes;
1041 
1042  void createSymbolLayerTable( QgsVectorLayer *vl, const QgsCoordinateTransform &ct, OGRDataSourceH ds );
1043  gdal::ogr_feature_unique_ptr createFeature( const QgsFeature &feature );
1044  bool writeFeature( OGRLayerH layer, OGRFeatureH feature );
1045 
1047  QgsVectorFileWriter::WriterError exportFeaturesSymbolLevels( const PreparedWriterDetails &details, QgsFeatureIterator &fit, const QgsCoordinateTransform &ct, QString *errorMessage = nullptr );
1048  double mmScaleFactor( double scale, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits );
1049  double mapUnitScaleFactor( double scale, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits );
1050 
1051  void startRender( QgsFeatureRenderer *sourceRenderer, const QgsFields &fields );
1052  void stopRender();
1053  std::unique_ptr< QgsFeatureRenderer > createSymbologyRenderer( QgsFeatureRenderer *sourceRenderer ) const;
1055  static void addRendererAttributes( QgsFeatureRenderer *renderer, QgsRenderContext &context, const QgsFields &fields, QgsAttributeList &attList );
1056 
1058  static QStringList concatenateOptions( const QMap<QString, Option *> &options );
1059 
1061  friend class TestQgsVectorFileWriter;
1062 };
1063 
1064 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsVectorFileWriter::EditionCapabilities )
1065 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsVectorFileWriter::VectorFormatOptions )
1066 
1067 // clazy:excludeall=qstring-allocations
1068 
1069 #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 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:51
Container of fields for a vector layer.
Definition: qgsfields.h:45
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:125
A structured metadata store for a map layer.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
Contains information about the context of a rendering operation.
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.
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.
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
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:133
std::unique_ptr< std::remove_pointer< OGRDataSourceH >::type, OGRDataSourceDeleter > ogr_datasource_unique_ptr
Scoped OGR data source.
Definition: qgsogrutils.h:118
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:882
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:37
QList< int > QgsAttributeList
Definition: qgsfield.h:26
const QgsField & field
Definition: qgsfield.h:463
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,...