QGIS API Documentation 3.43.0-Master (9e873c7bc91)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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 69 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 99 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 79 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 89 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 104 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 64 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 94 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 74 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 84 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 109 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 54 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 59 of file qgsvectorlayerexporter.cpp.


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