QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsVectorLayerExporter::ExportOptions Class Reference

Encapsulates options for use with QgsVectorLayerExporter. More...

#include <qgsvectorlayerexporter.h>

Public Member Functions

QgsCoordinateReferenceSystem destinationCrs () const
 Returns the destination coordinate reference system used for exported features.
const QgsExpressionContextexpressionContext () const
 Returns the expression context used when a filterExpression() is set.
QgsReferencedRectangle extent () const
 Returns the extent filter for the features to export.
QString filterExpression () const
 Returns the filter expression for features to export.
QList< QgsVectorLayerExporter::OutputFieldoutputFields () const
 Returns the output field definitions for the destination table.
bool selectedOnly () const
 Returns whether the export will only include selected features.
void setDestinationCrs (const QgsCoordinateReferenceSystem &crs)
 Sets the destination coordinate reference system to use for exported features.
void setExpressionContext (const QgsExpressionContext &context)
 Sets the expression context to use when a filterExpression() is set.
void setExtent (const QgsReferencedRectangle &extent)
 Sets an extent filter for the features to export.
void setFilterExpression (const QString &expression)
 Set the filter expression for the features to export.
void setOutputFields (const QList< QgsVectorLayerExporter::OutputField > &fields)
 Sets the output field definitions for the destination table.
void setSelectedOnly (bool selected)
 Sets whether the export should only include selected features.
void setTransformContext (const QgsCoordinateTransformContext &context)
 Sets the coordinate transform context to use when transforming exported features.
QgsCoordinateTransformContext transformContext () const
 Returns the coordinate transform context used when transforming exported features.

Detailed Description

Encapsulates options for use with QgsVectorLayerExporter.

Since
QGIS 3.44

Definition at line 106 of file qgsvectorlayerexporter.h.

Member Function Documentation

◆ destinationCrs()

QgsCoordinateReferenceSystem QgsVectorLayerExporter::ExportOptions::destinationCrs ( ) const

Returns the destination coordinate reference system used for exported features.

See also
setDestinationCrs()

Definition at line 72 of file qgsvectorlayerexporter.cpp.

◆ expressionContext()

const QgsExpressionContext & QgsVectorLayerExporter::ExportOptions::expressionContext ( ) const

Returns the expression context used when a filterExpression() is set.

See also
setExpressionContext()

Definition at line 102 of file qgsvectorlayerexporter.cpp.

◆ extent()

QgsReferencedRectangle QgsVectorLayerExporter::ExportOptions::extent ( ) const

Returns the extent filter for the features to export.

Only features with a bounding box intersecting this extent will be exported.

Note
This option only applies when the QgsVectorLayerExporter::exportLayer() method is used.
See also
setExtent()

Definition at line 82 of file qgsvectorlayerexporter.cpp.

◆ filterExpression()

QString QgsVectorLayerExporter::ExportOptions::filterExpression ( ) const

Returns the filter expression for features to export.

Only features matching this expression will be exported.

Warning
This setting is incompatible with selectedOnly()
Note
This option only applies when the QgsVectorLayerExporter::exportLayer() method is used.
See also
expressionContext()
setFilterExpression()

Definition at line 92 of file qgsvectorlayerexporter.cpp.

◆ outputFields()

QList< QgsVectorLayerExporter::OutputField > QgsVectorLayerExporter::ExportOptions::outputFields ( ) const

Returns the output field definitions for the destination table.

If empty, all input fields will be copied directly.

Note
This option only applies when the QgsVectorLayerExporter::exportLayer() method is used.
See also
setOutputFields()

Definition at line 107 of file qgsvectorlayerexporter.cpp.

◆ selectedOnly()

bool QgsVectorLayerExporter::ExportOptions::selectedOnly ( ) const
inline

Returns whether the export will only include selected features.

Warning
This setting is incompatible with filterExpression()
Note
This option only applies when the QgsVectorLayerExporter::exportLayer() method is used.
See also
setSelectedOnly()

Definition at line 130 of file qgsvectorlayerexporter.h.

◆ setDestinationCrs()

void QgsVectorLayerExporter::ExportOptions::setDestinationCrs ( const QgsCoordinateReferenceSystem & crs)

Sets the destination coordinate reference system to use for exported features.

See also
destinationCrs()

Definition at line 67 of file qgsvectorlayerexporter.cpp.

◆ setExpressionContext()

void QgsVectorLayerExporter::ExportOptions::setExpressionContext ( const QgsExpressionContext & context)

Sets the expression context to use when a filterExpression() is set.

See also
expressionContext()

Definition at line 97 of file qgsvectorlayerexporter.cpp.

◆ setExtent()

void QgsVectorLayerExporter::ExportOptions::setExtent ( const QgsReferencedRectangle & extent)

Sets an extent filter for the features to export.

Only features with a bounding box intersecting extent will be exported.

Note
This option only applies when the QgsVectorLayerExporter::exportLayer() method is used.
See also
extent()

Definition at line 77 of file qgsvectorlayerexporter.cpp.

◆ setFilterExpression()

void QgsVectorLayerExporter::ExportOptions::setFilterExpression ( const QString & expression)

Set the filter expression for the features to export.

Only features matching this expression will be exported.

Warning
This setting is incompatible with setSelectedOnly()
Note
This option only applies when the QgsVectorLayerExporter::exportLayer() method is used.
See also
setExpressionContext()
filterExpression()

Definition at line 87 of file qgsvectorlayerexporter.cpp.

◆ setOutputFields()

void QgsVectorLayerExporter::ExportOptions::setOutputFields ( const QList< QgsVectorLayerExporter::OutputField > & fields)

Sets the output field definitions for the destination table.

If empty, all input fields will be copied directly.

Note
This option only applies when the QgsVectorLayerExporter::exportLayer() method is used.
See also
outputFields()

Definition at line 112 of file qgsvectorlayerexporter.cpp.

◆ setSelectedOnly()

void QgsVectorLayerExporter::ExportOptions::setSelectedOnly ( bool selected)
inline

Sets whether the export should only include selected features.

Warning
This setting is incompatible with setFilterExpression()
Note
This option only applies when the QgsVectorLayerExporter::exportLayer() method is used.
See also
selectedOnly()

Definition at line 119 of file qgsvectorlayerexporter.h.

◆ setTransformContext()

void QgsVectorLayerExporter::ExportOptions::setTransformContext ( const QgsCoordinateTransformContext & context)

Sets the coordinate transform context to use when transforming exported features.

See also
transformContext()

Definition at line 57 of file qgsvectorlayerexporter.cpp.

◆ transformContext()

QgsCoordinateTransformContext QgsVectorLayerExporter::ExportOptions::transformContext ( ) const

Returns the coordinate transform context used when transforming exported features.

See also
setTransformContext()

Definition at line 62 of file qgsvectorlayerexporter.cpp.


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