QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
QgsVectorFileWriter::SaveVectorOptions Class Reference

Options to pass to writeAsVectorFormat() More...

#include <qgsvectorfilewriter.h>

Public Member Functions

 SaveVectorOptions ()
 Constructor.
 
virtual ~SaveVectorOptions ()=default
 

Public Attributes

QgsVectorFileWriter::ActionOnExistingFile actionOnExistingFile = CreateOrOverwriteFile
 Action on existing file.
 
QgsAttributeList attributes
 Attributes to export (empty means all unless skipAttributeCreation is set)
 
QStringList attributesExportNames
 Attributes export names.
 
QgsCoordinateTransform ct
 Transform to reproject exported geometries with, or invalid transform for no transformation.
 
QStringList datasourceOptions
 List of OGR data source creation options.
 
QString driverName
 OGR driver to use.
 
QgsFeedbackfeedback = nullptr
 Optional feedback object allowing cancellation of layer save.
 
FieldNameSource fieldNameSource = Original
 Source for exported field names.
 
QgsVectorFileWriter::FieldValueConverterfieldValueConverter = nullptr
 Field value converter.
 
QString fileEncoding
 Encoding to use.
 
QgsRectangle filterExtent
 If not empty, only features intersecting the extent will be saved.
 
bool forceMulti = false
 Sets to true to force creation of multi* geometries.
 
bool includeConstraints = false
 Set to true to transfer field constraints to the exported vector file.
 
bool includeZ = false
 Sets to true to include z dimension in output. This option is only valid if overrideGeometryType is set.
 
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.
 
QStringList layerOptions
 List of OGR layer creation options.
 
bool onlySelectedFeatures = false
 Write only selected features of layer.
 
Qgis::WkbType overrideGeometryType = Qgis::WkbType::Unknown
 Set to a valid geometry type to override the default geometry type for the layer.
 
bool saveMetadata = false
 Set to true to save layer metadata for the exported vector file.
 
bool skipAttributeCreation = false
 Only write geometries.
 
Qgis::FeatureSymbologyExport symbologyExport = Qgis::FeatureSymbologyExport::NoSymbology
 Symbology to export.
 
double symbologyScale = 1.0
 Scale of symbology.
 

Detailed Description

Options to pass to writeAsVectorFormat()

Since
QGIS 3.0

Definition at line 451 of file qgsvectorfilewriter.h.

Constructor & Destructor Documentation

◆ SaveVectorOptions()

QgsVectorFileWriter::SaveVectorOptions::SaveVectorOptions ( )

Constructor.

Definition at line 3305 of file qgsvectorfilewriter.cpp.

◆ ~SaveVectorOptions()

virtual QgsVectorFileWriter::SaveVectorOptions::~SaveVectorOptions ( )
virtualdefault

Member Data Documentation

◆ actionOnExistingFile

QgsVectorFileWriter::ActionOnExistingFile QgsVectorFileWriter::SaveVectorOptions::actionOnExistingFile = CreateOrOverwriteFile

Action on existing file.

Definition at line 466 of file qgsvectorfilewriter.h.

◆ attributes

QgsAttributeList QgsVectorFileWriter::SaveVectorOptions::attributes

Attributes to export (empty means all unless skipAttributeCreation is set)

Definition at line 490 of file qgsvectorfilewriter.h.

◆ attributesExportNames

QStringList QgsVectorFileWriter::SaveVectorOptions::attributesExportNames

Attributes export names.

Definition at line 493 of file qgsvectorfilewriter.h.

◆ ct

QgsCoordinateTransform QgsVectorFileWriter::SaveVectorOptions::ct

Transform to reproject exported geometries with, or invalid transform for no transformation.

Definition at line 475 of file qgsvectorfilewriter.h.

◆ datasourceOptions

QStringList QgsVectorFileWriter::SaveVectorOptions::datasourceOptions

List of OGR data source creation options.

Definition at line 481 of file qgsvectorfilewriter.h.

◆ driverName

QString QgsVectorFileWriter::SaveVectorOptions::driverName

OGR driver to use.

Definition at line 460 of file qgsvectorfilewriter.h.

◆ feedback

QgsFeedback* QgsVectorFileWriter::SaveVectorOptions::feedback = nullptr

Optional feedback object allowing cancellation of layer save.

Definition at line 525 of file qgsvectorfilewriter.h.

◆ fieldNameSource

FieldNameSource QgsVectorFileWriter::SaveVectorOptions::fieldNameSource = Original

Source for exported field names.

Since
QGIS 3.18

Definition at line 532 of file qgsvectorfilewriter.h.

◆ fieldValueConverter

QgsVectorFileWriter::FieldValueConverter* QgsVectorFileWriter::SaveVectorOptions::fieldValueConverter = nullptr

Field value converter.

Ownership is not transferred and callers must ensure that the lifetime of fieldValueConverter exceeds the lifetime of the QgsVectorFileWriter object.

Definition at line 522 of file qgsvectorfilewriter.h.

◆ fileEncoding

QString QgsVectorFileWriter::SaveVectorOptions::fileEncoding

Encoding to use.

Definition at line 469 of file qgsvectorfilewriter.h.

◆ filterExtent

QgsRectangle QgsVectorFileWriter::SaveVectorOptions::filterExtent

If not empty, only features intersecting the extent will be saved.

Definition at line 502 of file qgsvectorfilewriter.h.

◆ forceMulti

bool QgsVectorFileWriter::SaveVectorOptions::forceMulti = false

Sets to true to force creation of multi* geometries.

Definition at line 511 of file qgsvectorfilewriter.h.

◆ includeConstraints

bool QgsVectorFileWriter::SaveVectorOptions::includeConstraints = false

Set to true to transfer field constraints to the exported vector file.

Support for field constraints depends on the output file format.

Since
QGIS 3.34

Definition at line 557 of file qgsvectorfilewriter.h.

◆ includeZ

bool QgsVectorFileWriter::SaveVectorOptions::includeZ = false

Sets to true to include z dimension in output. This option is only valid if overrideGeometryType is set.

Definition at line 514 of file qgsvectorfilewriter.h.

◆ layerMetadata

QgsLayerMetadata QgsVectorFileWriter::SaveVectorOptions::layerMetadata

Layer metadata to save for the exported vector file.

This will only be used if saveMetadata is true.

See also
saveMetadata
Since
QGIS 3.20

Definition at line 548 of file qgsvectorfilewriter.h.

◆ layerName

QString QgsVectorFileWriter::SaveVectorOptions::layerName

Layer name. If let empty, it will be derived from the filename.

Definition at line 463 of file qgsvectorfilewriter.h.

◆ layerOptions

QStringList QgsVectorFileWriter::SaveVectorOptions::layerOptions

List of OGR layer creation options.

Definition at line 484 of file qgsvectorfilewriter.h.

◆ onlySelectedFeatures

bool QgsVectorFileWriter::SaveVectorOptions::onlySelectedFeatures = false

Write only selected features of layer.

Definition at line 478 of file qgsvectorfilewriter.h.

◆ overrideGeometryType

Qgis::WkbType QgsVectorFileWriter::SaveVectorOptions::overrideGeometryType = Qgis::WkbType::Unknown

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.

Definition at line 508 of file qgsvectorfilewriter.h.

◆ saveMetadata

bool QgsVectorFileWriter::SaveVectorOptions::saveMetadata = false

Set to true to save layer metadata for the exported vector file.

See also
layerMetadata
Since
QGIS 3.20

Definition at line 540 of file qgsvectorfilewriter.h.

◆ skipAttributeCreation

bool QgsVectorFileWriter::SaveVectorOptions::skipAttributeCreation = false

Only write geometries.

Definition at line 487 of file qgsvectorfilewriter.h.

◆ symbologyExport

Qgis::FeatureSymbologyExport QgsVectorFileWriter::SaveVectorOptions::symbologyExport = Qgis::FeatureSymbologyExport::NoSymbology

Symbology to export.

Definition at line 496 of file qgsvectorfilewriter.h.

◆ symbologyScale

double QgsVectorFileWriter::SaveVectorOptions::symbologyScale = 1.0

Scale of symbology.

Definition at line 499 of file qgsvectorfilewriter.h.


The documentation for this class was generated from the following files: