|
QGIS API Documentation 3.99.0-Master (1d785854362)
|
A convenience class for writing vector layers to disk based formats (e.g. More...
#include <qgsvectorfilewriter.h>

Classes | |
| class | BoolOption |
| An available option for configuring file writing for a particular output format, presenting an boolean option. More... | |
| struct | DriverDetails |
| Details of available driver formats. More... | |
| class | FieldValueConverter |
| Interface to convert raw field values to their user-friendly values. More... | |
| struct | FilterFormatDetails |
| Details of available filters and formats. More... | |
| class | HiddenOption |
| A hidden option for file writing for a particular output format. More... | |
| class | IntOption |
| An available option for configuring file writing for a particular output format, presenting an integer option. More... | |
| struct | MetaData |
| class | Option |
| Describes an available option for configuring file writing for a particular output format. More... | |
| class | SaveVectorOptions |
| Options to pass to QgsVectorFileWriter::writeAsVectorFormat(). More... | |
| class | SetOption |
| An available option for configuring file writing for a particular output format, presenting a choice of preset values. More... | |
| class | StringOption |
| An available option for configuring file writing for a particular output format, presenting a freeform string option. More... | |
Public Member Functions | |
| QgsVectorFileWriter (const QgsVectorFileWriter &rh)=delete | |
| Q_DECL_DEPRECATED | QgsVectorFileWriter (const QString &vectorFileName, const QString &fileEncoding, const QgsFields &fields, Qgis::WkbType geometryType, const QgsCoordinateReferenceSystem &srs, const QString &driverName, const QStringList &datasourceOptions, const QStringList &layerOptions, QString *newFilename, Qgis::FeatureSymbologyExport symbologyExport, QgsVectorFileWriter::FieldValueConverter *fieldValueConverter, const QString &layerName, QgsVectorFileWriter::ActionOnExistingFile action, QString *newLayer=nullptr, const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext(), QgsFeatureSink::SinkFlags sinkFlags=QgsFeatureSink::SinkFlags(), FieldNameSource fieldNameSource=Original, bool includeConstraints=false, bool setFieldDomains=true, const QgsAbstractDatabaseProviderConnection *sourceDatabaseProviderConnection=nullptr) |
| Create a new vector file writer. | |
| Q_DECL_DEPRECATED | QgsVectorFileWriter (const QString &vectorFileName, const QString &fileEncoding, const QgsFields &fields, Qgis::WkbType geometryType, const QgsCoordinateReferenceSystem &srs=QgsCoordinateReferenceSystem(), const QString &driverName="GPKG", const QStringList &datasourceOptions=QStringList(), const QStringList &layerOptions=QStringList(), QString *newFilename=nullptr, Qgis::FeatureSymbologyExport symbologyExport=Qgis::FeatureSymbologyExport::NoSymbology, QgsFeatureSink::SinkFlags sinkFlags=QgsFeatureSink::SinkFlags(), QString *newLayer=nullptr, const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext(), FieldNameSource fieldNameSource=Original) |
| Create a new vector file writer. | |
| ~QgsVectorFileWriter () override | |
| Close opened shapefile for writing. | |
| bool | addFeature (QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override |
| Adds a single feature to the sink. | |
| virtual bool | addFeatures (QgsFeatureIterator &iterator, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) |
| Adds all features from the specified iterator to the sink. | |
| bool | addFeatures (QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override |
| Adds a list of features to the sink. | |
| bool | addFeatureWithStyle (QgsFeature &feature, QgsFeatureRenderer *renderer, Qgis::DistanceUnit outputUnit=Qgis::DistanceUnit::Meters) |
| Adds a feature to the currently opened data source, using the style from a specified renderer. | |
| Qgis::VectorFileWriterCapabilities | capabilities () const |
| Returns the capabilities supported by the writer. | |
| QString | driver () const |
| Returns the GDAL (short) driver name associated with the output file. | |
| QString | driverLongName () const |
| Returns the GDAL long driver name associated with the output file. | |
| QString | errorMessage () const |
| Retrieves error message. | |
| QgsVectorFileWriter::WriterError | hasError () const |
| Checks whether there were any errors in constructor. | |
| QString | lastError () const override |
| Returns the most recent error encountered by the sink, e.g. | |
| QgsVectorFileWriter & | operator= (const QgsVectorFileWriter &rh)=delete |
| void | setSymbologyExport (Qgis::FeatureSymbologyExport symExport) |
| Sets the feature symbology export handling for the writer. | |
| void | setSymbologyScale (double scale) |
| Set reference scale for output. | |
| QMap< int, int > | sourceFieldIndexToWriterFieldIndex () const |
| Returns the map of original source field index to output file field index. | |
| Qgis::FeatureSymbologyExport | symbologyExport () const |
| Returns the feature symbology export handling for the writer. | |
| double | symbologyScale () const |
| Returns the reference scale for output. | |
| Public Member Functions inherited from QgsFeatureSink | |
| virtual | ~QgsFeatureSink ()=default |
| virtual void | finalize () |
| Finalizes the sink, flushing any buffered features to the destination. | |
| virtual bool | flushBuffer () |
| Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to the sink's destination. | |
Static Public Member Functions | |
| static bool | areThereNewFieldsToCreate (const QString &datasetName, const QString &layerName, QgsVectorLayer *layer, const QgsAttributeList &attributes) |
| Returns whether there are among the attributes specified some that do not exist yet in the layer. | |
| static QString | convertCodecNameForEncodingOption (const QString &codecName) |
| Converts codec name to string passed to ENCODING layer creation option of OGR Shapefile. | |
| static QgsVectorFileWriter * | create (const QString &fileName, const QgsFields &fields, Qgis::WkbType geometryType, const QgsCoordinateReferenceSystem &srs, const QgsCoordinateTransformContext &transformContext, const QgsVectorFileWriter::SaveVectorOptions &options, QgsFeatureSink::SinkFlags sinkFlags=QgsFeatureSink::SinkFlags(), QString *newFilename=nullptr, QString *newLayer=nullptr) |
| Create a new vector file writer. | |
| static QStringList | defaultDatasetOptions (const QString &driverName) |
| Returns a list of the default dataset options for a specified driver. | |
| static QStringList | defaultLayerOptions (const QString &driverName) |
| Returns a list of the default layer options for a specified driver. | |
| static bool | deleteShapeFile (const QString &fileName) |
| Delete a shapefile (and its accompanying shx / dbf / prj / qix / qpj / cpg / sbn / sbx / idm / ind). | |
| static QString | driverForExtension (const QString &extension) |
| Returns the OGR driver name for a specified file extension. | |
| static bool | driverMetadata (const QString &driverName, MetaData &driverMetadata) |
| static QgsVectorFileWriter::EditionCapabilities | editionCapabilities (const QString &datasetName) |
| Returns edition capabilities for an existing dataset name. | |
| static QString | fileFilterString (VectorFormatOptions options=SortRecommended) |
| Returns filter string that can be used for dialogs. | |
| static QString | filterForDriver (const QString &driverName) |
| Creates a filter for an OGR driver key. | |
| static QList< QgsVectorFileWriter::DriverDetails > | ogrDriverList (VectorFormatOptions options=SortRecommended) |
| Returns the driver list that can be used for dialogs. | |
| static OGRwkbGeometryType | ogrTypeFromWkbType (Qgis::WkbType type) |
| Gets the ogr geometry type from an internal QGIS wkb type enum. | |
| static QList< QgsVectorFileWriter::FilterFormatDetails > | supportedFiltersAndFormats (VectorFormatOptions options=SortRecommended) |
| Returns a list or pairs, with format filter string as first element and OGR format key as second element. | |
| static QStringList | supportedFormatExtensions (VectorFormatOptions options=SortRecommended) |
| Returns a list of file extensions for supported formats, e.g "shp", "gpkg". | |
| static bool | supportsFeatureStyles (const QString &driverName) |
Returns true if the specified driverName supports feature styles. | |
| static bool | targetLayerExists (const QString &datasetName, const QString &layerName) |
| Returns whether the target layer already exists. | |
| static Q_DECL_DEPRECATED QgsVectorFileWriter::WriterError | writeAsVectorFormat (QgsVectorLayer *layer, const QString &fileName, const QgsVectorFileWriter::SaveVectorOptions &options, QString *newFilename=nullptr, QString *errorMessage=nullptr, QString *newLayer=nullptr) |
| Writes a layer out to a vector file. | |
| static Q_DECL_DEPRECATED QgsVectorFileWriter::WriterError | writeAsVectorFormat (QgsVectorLayer *layer, const QString &fileName, const QString &fileEncoding, const QgsCoordinateReferenceSystem &destCRS=QgsCoordinateReferenceSystem(), const QString &driverName="GPKG", bool onlySelected=false, QString *errorMessage=nullptr, const QStringList &datasourceOptions=QStringList(), const QStringList &layerOptions=QStringList(), bool skipAttributeCreation=false, QString *newFilename=nullptr, Qgis::FeatureSymbologyExport symbologyExport=Qgis::FeatureSymbologyExport::NoSymbology, double symbologyScale=1.0, const QgsRectangle *filterExtent=nullptr, Qgis::WkbType overrideGeometryType=Qgis::WkbType::Unknown, bool forceMulti=false, bool includeZ=false, const QgsAttributeList &attributes=QgsAttributeList(), QgsVectorFileWriter::FieldValueConverter *fieldValueConverter=nullptr, QString *newLayer=nullptr) |
| Write contents of vector layer to an (OGR supported) vector format. | |
| static Q_DECL_DEPRECATED QgsVectorFileWriter::WriterError | writeAsVectorFormat (QgsVectorLayer *layer, const QString &fileName, const QString &fileEncoding, const QgsCoordinateTransform &ct, const QString &driverName="GPKG", bool onlySelected=false, QString *errorMessage=nullptr, const QStringList &datasourceOptions=QStringList(), const QStringList &layerOptions=QStringList(), bool skipAttributeCreation=false, QString *newFilename=nullptr, Qgis::FeatureSymbologyExport symbologyExport=Qgis::FeatureSymbologyExport::NoSymbology, double symbologyScale=1.0, const QgsRectangle *filterExtent=nullptr, Qgis::WkbType overrideGeometryType=Qgis::WkbType::Unknown, bool forceMulti=false, bool includeZ=false, const QgsAttributeList &attributes=QgsAttributeList(), QgsVectorFileWriter::FieldValueConverter *fieldValueConverter=nullptr, QString *newLayer=nullptr) |
| Writes a layer out to a vector file. | |
| static Q_DECL_DEPRECATED QgsVectorFileWriter::WriterError | writeAsVectorFormatV2 (QgsVectorLayer *layer, const QString &fileName, const QgsCoordinateTransformContext &transformContext, const QgsVectorFileWriter::SaveVectorOptions &options, QString *newFilename=nullptr, QString *newLayer=nullptr, QString *errorMessage=nullptr) |
| Writes a layer out to a vector file. | |
| static QgsVectorFileWriter::WriterError | writeAsVectorFormatV3 (QgsVectorLayer *layer, const QString &fileName, const QgsCoordinateTransformContext &transformContext, const QgsVectorFileWriter::SaveVectorOptions &options, QString *errorMessage=nullptr, QString *newFilename=nullptr, QString *newLayer=nullptr) |
| Writes a layer out to a vector file. | |
Protected Member Functions | |
| OGRGeometryH | createEmptyGeometry (Qgis::WkbType wkbType) |
Protected Attributes | |
| QMap< int, int > | mAttrIdxToOgrLayerIdx |
| Map attribute indices to OGR layer field indexes such as they are on the current mLayer instance. | |
| QMap< int, int > | mAttrIdxToProviderIdx |
| Map attribute indices to OGR provider field indexes such as they are after the OGR provider has been created. | |
| QTextCodec * | mCodec = nullptr |
| gdal::ogr_datasource_unique_ptr | mDS |
| WriterError | mError |
| Contains error value if construction was not successful. | |
| QString | mErrorMessage |
| QgsFields | mFields |
| FieldValueConverter * | mFieldValueConverter = nullptr |
| Field value converter. | |
| bool | mIncludeConstraints = false |
| Whether to transfer field constraints to output. | |
| OGRLayerH | mLayer = nullptr |
| QString | mOgrDriverLongName |
| QString | mOgrDriverName |
| OGRSpatialReferenceH | mOgrRef = nullptr |
| bool | mSetFieldDomains = true |
| Whether to set field domains to output. | |
| QMap< QgsSymbolLayer *, QString > | mSymbolLayerTable |
| Qgis::FeatureSymbologyExport | mSymbologyExport = Qgis::FeatureSymbologyExport::NoSymbology |
| double | mSymbologyScale |
| Scale for symbology export (e.g. for symbols units in map units). | |
| Qgis::WkbType | mWkbType |
| Geometry type which is being used. | |
Friends | |
| class | QgsVectorFileWriterTask |
| class | TestQgsVectorFileWriter |
A convenience class for writing vector layers to disk based formats (e.g.
Shapefiles, GeoPackage).
There are two possibilities how to use this class:
Definition at line 52 of file qgsvectorfilewriter.h.
| typedef QFlags< EditionCapability > QgsVectorFileWriter::EditionCapabilities |
Combination of CanAddNewLayer, CanAppendToExistingLayer, CanAddNewFieldsToExistingLayer or CanDeleteLayer.
Definition at line 271 of file qgsvectorfilewriter.h.
| typedef QFlags< VectorFormatOption > QgsVectorFileWriter::VectorFormatOptions |
Definition at line 215 of file qgsvectorfilewriter.h.
Enumeration to describe how to handle existing files.
Definition at line 276 of file qgsvectorfilewriter.h.
Edition capability flags.
| Enumerator | |
|---|---|
| CanAddNewLayer | Flag to indicate that a new layer can be added to the dataset. |
| CanAppendToExistingLayer | Flag to indicate that new features can be added to an existing layer. |
| CanAddNewFieldsToExistingLayer | Flag to indicate that new fields can be added to an existing layer. Imply CanAppendToExistingLayer. |
| CanDeleteLayer | Flag to indicate that an existing layer can be deleted. |
Definition at line 253 of file qgsvectorfilewriter.h.
Source for exported field names.
| Enumerator | |
|---|---|
| Original | Use original field names. |
| PreferAlias | Use the field alias as the exported field name, wherever one is set. Otherwise use the original field names. |
Definition at line 200 of file qgsvectorfilewriter.h.
| Enumerator | |
|---|---|
| Set | |
| String | |
| Int | |
| Hidden | |
Definition at line 55 of file qgsvectorfilewriter.h.
Options for sorting and filtering vector formats.
Definition at line 209 of file qgsvectorfilewriter.h.
Definition at line 180 of file qgsvectorfilewriter.h.
| QgsVectorFileWriter::QgsVectorFileWriter | ( | const QString & | vectorFileName, |
| const QString & | fileEncoding, | ||
| const QgsFields & | fields, | ||
| Qgis::WkbType | geometryType, | ||
| const QgsCoordinateReferenceSystem & | srs = QgsCoordinateReferenceSystem(), | ||
| const QString & | driverName = "GPKG", | ||
| const QStringList & | datasourceOptions = QStringList(), | ||
| const QStringList & | layerOptions = QStringList(), | ||
| QString * | newFilename = nullptr, | ||
| Qgis::FeatureSymbologyExport | symbologyExport = Qgis::FeatureSymbologyExport::NoSymbology, | ||
| QgsFeatureSink::SinkFlags | sinkFlags = QgsFeatureSink::SinkFlags(), | ||
| QString * | newLayer = nullptr, | ||
| const QgsCoordinateTransformContext & | transformContext = QgsCoordinateTransformContext(), | ||
| FieldNameSource | fieldNameSource = Original ) |
Create a new vector file writer.
Definition at line 78 of file qgsvectorfilewriter.cpp.
| QgsVectorFileWriter::QgsVectorFileWriter | ( | const QString & | vectorFileName, |
| const QString & | fileEncoding, | ||
| const QgsFields & | fields, | ||
| Qgis::WkbType | geometryType, | ||
| const QgsCoordinateReferenceSystem & | srs, | ||
| const QString & | driverName, | ||
| const QStringList & | datasourceOptions, | ||
| const QStringList & | layerOptions, | ||
| QString * | newFilename, | ||
| Qgis::FeatureSymbologyExport | symbologyExport, | ||
| QgsVectorFileWriter::FieldValueConverter * | fieldValueConverter, | ||
| const QString & | layerName, | ||
| QgsVectorFileWriter::ActionOnExistingFile | action, | ||
| QString * | newLayer = nullptr, | ||
| const QgsCoordinateTransformContext & | transformContext = QgsCoordinateTransformContext(), | ||
| QgsFeatureSink::SinkFlags | sinkFlags = QgsFeatureSink::SinkFlags(), | ||
| FieldNameSource | fieldNameSource = Original, | ||
| bool | includeConstraints = false, | ||
| bool | setFieldDomains = true, | ||
| const QgsAbstractDatabaseProviderConnection * | sourceDatabaseProviderConnection = nullptr ) |
Create a new vector file writer.
| vectorFileName | file name to write to |
| fileEncoding | encoding to use |
| fields | fields to write |
| geometryType | geometry type of output file |
| srs | spatial reference system of output file |
| driverName | OGR driver to use |
| datasourceOptions | list of OGR data source creation options |
| layerOptions | list of OGR layer creation options |
| newFilename | potentially modified file name (output parameter) |
| symbologyExport | symbology to export |
| fieldValueConverter | field value converter (added in QGIS 2.16) |
| layerName | layer name. If let empty, it will be derived from the filename (added in QGIS 3.0) |
| action | action on existing file (added in QGIS 3.0) |
| newLayer | potentially modified layer name (output parameter) (added in QGIS 3.4) |
| transformContext | transform context, needed if the output file srs is forced to specific crs (added in QGIS 3.10.3) |
| sinkFlags | feature sink flags (added in QGIS 3.10.3) |
| fieldNameSource | source for field names (since QGIS 3.18) |
| includeConstraints | set to true to copy field constraints to the destination layer (since QGIS 3.34) |
| setFieldDomains | set to true to copy field domains (since QGIS 3.36) |
| sourceDatabaseProviderConnection | source database provider connection, for field domains (since QGIS 3.36) |
Definition at line 102 of file qgsvectorfilewriter.cpp.
|
delete |
|
override |
Close opened shapefile for writing.
Definition at line 3368 of file qgsvectorfilewriter.cpp.
|
overridevirtual |
Adds a single feature to the sink.
Feature addition behavior is controlled by the specified flags.
true in case of success and false in case of failure Reimplemented from QgsFeatureSink.
Definition at line 2737 of file qgsvectorfilewriter.cpp.
|
virtual |
Adds all features from the specified iterator to the sink.
Feature addition behavior is controlled by the specified flags.
true if all features were added successfully, or false if any feature could not be added Reimplemented from QgsFeatureSink.
Definition at line 108 of file qgsfeaturesink.cpp.
|
overridevirtual |
Adds a list of features to the sink.
Feature addition behavior is controlled by the specified flags.
true in case of success and false in case of failure Implements QgsFeatureSink.
Definition at line 2742 of file qgsvectorfilewriter.cpp.
| bool QgsVectorFileWriter::addFeatureWithStyle | ( | QgsFeature & | feature, |
| QgsFeatureRenderer * | renderer, | ||
| Qgis::DistanceUnit | outputUnit = Qgis::DistanceUnit::Meters ) |
Adds a feature to the currently opened data source, using the style from a specified renderer.
Definition at line 2758 of file qgsvectorfilewriter.cpp.
|
static |
Returns whether there are among the attributes specified some that do not exist yet in the layer.
Definition at line 4705 of file qgsvectorfilewriter.cpp.
| Qgis::VectorFileWriterCapabilities QgsVectorFileWriter::capabilities | ( | ) | const |
Returns the capabilities supported by the writer.
Definition at line 2732 of file qgsvectorfilewriter.cpp.
|
static |
Converts codec name to string passed to ENCODING layer creation option of OGR Shapefile.
Definition at line 4306 of file qgsvectorfilewriter.cpp.
|
static |
Create a new vector file writer.
| fileName | file name to write to |
| fields | fields to write |
| geometryType | geometry type of output file |
| srs | spatial reference system of output file |
| transformContext | coordinate transform context |
| options | save options |
| sinkFlags | feature sink flags |
| newFilename | potentially modified file name (output parameter) |
| newLayer | potentially modified layer name (output parameter) |
Definition at line 134 of file qgsvectorfilewriter.cpp.
|
protected |
Definition at line 1088 of file qgsvectorfilewriter.cpp.
|
static |
Returns a list of the default dataset options for a specified driver.
| driverName | name of OGR driver |
Definition at line 2689 of file qgsvectorfilewriter.cpp.
|
static |
Returns a list of the default layer options for a specified driver.
| driverName | name of OGR driver |
Definition at line 2698 of file qgsvectorfilewriter.cpp.
|
static |
Delete a shapefile (and its accompanying shx / dbf / prj / qix / qpj / cpg / sbn / sbx / idm / ind).
| fileName | /path/to/file.shp |
true if the file was deleted successfully Definition at line 3953 of file qgsvectorfilewriter.cpp.
| QString QgsVectorFileWriter::driver | ( | ) | const |
Returns the GDAL (short) driver name associated with the output file.
Definition at line 2722 of file qgsvectorfilewriter.cpp.
|
static |
Returns the OGR driver name for a specified file extension.
E.g. the driver name for the ".shp" extension is "ESRI Shapefile". If no suitable drivers are found then an empty string is returned.
Definition at line 4246 of file qgsvectorfilewriter.cpp.
| QString QgsVectorFileWriter::driverLongName | ( | ) | const |
Returns the GDAL long driver name associated with the output file.
Definition at line 2727 of file qgsvectorfilewriter.cpp.
|
static |
Definition at line 2665 of file qgsvectorfilewriter.cpp.
|
static |
Returns edition capabilities for an existing dataset name.
Definition at line 4650 of file qgsvectorfilewriter.cpp.
| QString QgsVectorFileWriter::errorMessage | ( | ) | const |
Retrieves error message.
Definition at line 2717 of file qgsvectorfilewriter.cpp.
|
static |
Returns filter string that can be used for dialogs.
The options argument can be used to control the sorting and filtering of returned drivers.
Definition at line 4281 of file qgsvectorfilewriter.cpp.
|
static |
Creates a filter for an OGR driver key.
Definition at line 4295 of file qgsvectorfilewriter.cpp.
| QgsVectorFileWriter::WriterError QgsVectorFileWriter::hasError | ( | ) | const |
Checks whether there were any errors in constructor.
Definition at line 2712 of file qgsvectorfilewriter.cpp.
|
overridevirtual |
Returns the most recent error encountered by the sink, e.g.
when a call to addFeatures() returns false.
Reimplemented from QgsFeatureSink.
Definition at line 2753 of file qgsvectorfilewriter.cpp.
|
static |
Returns the driver list that can be used for dialogs.
It contains all OGR drivers plus some additional internal QGIS driver names to distinguish between more supported formats of the same OGR driver.
The returned list consists of structs containing the driver long name (e.g. user-friendly display name for the format) and internal driver short name.
The options argument can be used to control the sorting and filtering of returned drivers.
Definition at line 4144 of file qgsvectorfilewriter.cpp.
|
static |
Gets the ogr geometry type from an internal QGIS wkb type enum.
Will drop M values and convert Z to 2.5D where required.
Definition at line 2707 of file qgsvectorfilewriter.cpp.
|
delete |
|
inline |
Sets the feature symbology export handling for the writer.
Definition at line 926 of file qgsvectorfilewriter.h.
| void QgsVectorFileWriter::setSymbologyScale | ( | double | scale | ) |
Set reference scale for output.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
Definition at line 3979 of file qgsvectorfilewriter.cpp.
|
inline |
Returns the map of original source field index to output file field index.
Definition at line 902 of file qgsvectorfilewriter.h.
|
static |
Returns a list or pairs, with format filter string as first element and OGR format key as second element.
The options argument can be used to control the sorting and filtering of returned formats.
Definition at line 4012 of file qgsvectorfilewriter.cpp.
|
static |
Returns a list of file extensions for supported formats, e.g "shp", "gpkg".
The options argument can be used to control the sorting and filtering of returned formats.
Definition at line 4102 of file qgsvectorfilewriter.cpp.
|
static |
Returns true if the specified driverName supports feature styles.
The driverName argument must be a valid GDAL driver name.
Definition at line 154 of file qgsvectorfilewriter.cpp.
|
inline |
Returns the feature symbology export handling for the writer.
Definition at line 919 of file qgsvectorfilewriter.h.
|
inline |
Returns the reference scale for output.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
Definition at line 933 of file qgsvectorfilewriter.h.
|
static |
Returns whether the target layer already exists.
Definition at line 4689 of file qgsvectorfilewriter.cpp.
|
static |
Writes a layer out to a vector file.
| layer | source layer to write |
| fileName | file name to write to |
| options | options. |
| newFilename | will be set to the new file name created (in case it is different to fileName). |
| errorMessage | will be set to the error message text, if an error occurs while writing the layer |
| newLayer | will be set to the new layer name created (in case it is different to the provided layer name) (added in QGIS 3.4, not available in python) |
Definition at line 3912 of file qgsvectorfilewriter.cpp.
|
static |
Write contents of vector layer to an (OGR supported) vector format.
| layer | layer to write |
| fileName | file name to write to |
| fileEncoding | encoding to use |
| destCRS | CRS to reproject exported geometries to, or invalid CRS for no reprojection |
| driverName | OGR driver to use |
| onlySelected | write only selected features of layer |
| errorMessage | will be set to the error message text, if an error occurs while writing the layer |
| datasourceOptions | list of OGR data source creation options |
| layerOptions | list of OGR layer creation options |
| skipAttributeCreation | only write geometries |
| newFilename | will be set to the new file name created (in case it is different to fileName). |
| symbologyExport | symbology to export |
| symbologyScale | scale of symbology |
| filterExtent | if not nullptr, only features intersecting the extent will be saved (added in QGIS 2.4) |
| overrideGeometryType | set to a valid geometry type to override the default geometry type for the layer. This parameter allows for conversion of geometryless tables to null geometries, etc (added in QGIS 2.14) |
| forceMulti | set to true to force creation of multipart geometries (added in QGIS 2.14) |
| includeZ | set to true to include z dimension in output. This option is only valid if overrideGeometryType is set. (added in QGIS 2.14) |
| attributes | attributes to export (empty means all unless skipAttributeCreation is set) |
| fieldValueConverter | field value converter (added in QGIS 2.16) |
| newLayer | will be set to the new layer name created (in case it is different to the provided layer name) (added in QGIS 3.4, not available in python) |
Definition at line 3386 of file qgsvectorfilewriter.cpp.
|
static |
Writes a layer out to a vector file.
| layer | layer to write |
| fileName | file name to write to |
| fileEncoding | encoding to use |
| ct | coordinate transform to reproject exported geometries with, or invalid transform for no transformation |
| driverName | OGR driver to use |
| onlySelected | write only selected features of layer |
| errorMessage | will be set to the error message text, if an error occurs while writing the layer |
| datasourceOptions | list of OGR data source creation options |
| layerOptions | list of OGR layer creation options |
| skipAttributeCreation | only write geometries |
| newFilename | will be set to the new file name created (in case it is different to fileName). |
| symbologyExport | symbology to export |
| symbologyScale | scale of symbology |
| filterExtent | if not nullptr, only features intersecting the extent will be saved (added in QGIS 2.4) |
| overrideGeometryType | set to a valid geometry type to override the default geometry type for the layer. This parameter allows for conversion of geometryless tables to null geometries, etc (added in QGIS 2.14) |
| forceMulti | set to true to force creation of multipart geometries (added in QGIS 2.14) |
| includeZ | set to true to include z dimension in output. This option is only valid if overrideGeometryType is set. (added in QGIS 2.14) |
| attributes | attributes to export (empty means all unless skipAttributeCreation is set) |
| fieldValueConverter | field value converter (added in QGIS 2.16) |
| newLayer | will be set to the new layer name created (in case it is different to the provided layer name) (added in QGIS 3.4, not available in python) |
Definition at line 3438 of file qgsvectorfilewriter.cpp.
|
static |
Writes a layer out to a vector file.
| layer | source layer to write |
| fileName | file name to write to |
| transformContext | coordinate transform context |
| options | save options |
| newFilename | potentially modified file name (output parameter) |
| newLayer | potentially modified layer name (output parameter) |
| errorMessage | will be set to the error message text, if an error occurs while writing the layer |
Definition at line 3927 of file qgsvectorfilewriter.cpp.
|
static |
Writes a layer out to a vector file.
| layer | source layer to write |
| fileName | file name to write to |
| transformContext | coordinate transform context |
| options | save options |
| newFilename | potentially modified file name (output parameter) |
| newLayer | potentially modified layer name (output parameter) |
| errorMessage | will be set to the error message text, if an error occurs while writing the layer |
Definition at line 3943 of file qgsvectorfilewriter.cpp.
|
friend |
Definition at line 1146 of file qgsvectorfilewriter.h.
|
friend |
Definition at line 1147 of file qgsvectorfilewriter.h.
|
protected |
Map attribute indices to OGR layer field indexes such as they are on the current mLayer instance.
Definition at line 1009 of file qgsvectorfilewriter.h.
|
protected |
Map attribute indices to OGR provider field indexes such as they are after the OGR provider has been created.
Definition at line 1006 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 999 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 989 of file qgsvectorfilewriter.h.
|
protected |
Contains error value if construction was not successful.
Definition at line 996 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 997 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 993 of file qgsvectorfilewriter.h.
|
protected |
Field value converter.
Definition at line 1022 of file qgsvectorfilewriter.h.
|
protected |
Whether to transfer field constraints to output.
Definition at line 1025 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 990 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 1019 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 1018 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 991 of file qgsvectorfilewriter.h.
|
protected |
Whether to set field domains to output.
Definition at line 1028 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 1013 of file qgsvectorfilewriter.h.
|
protected |
Definition at line 1011 of file qgsvectorfilewriter.h.
|
protected |
Scale for symbology export (e.g. for symbols units in map units).
Definition at line 1016 of file qgsvectorfilewriter.h.
|
protected |
Geometry type which is being used.
Definition at line 1002 of file qgsvectorfilewriter.h.