Class: QgsVectorLayerSaveAsDialog¶
Class to select destination file, type and CRS for ogr layers
Class Hierarchy¶
Base classes¶
Enums
Available dialog options. |
Methods
Returns |
|
Returns selected attributes that must be exported with their displayed values instead of their raw values. |
|
Returns a list of export names for attributes. |
|
Returns |
|
Returns the creation action. |
|
Returns the CRS chosen for export. |
|
Returns a list of additional data source options which are passed to OGR. |
|
Returns the selected encoding for the target file. |
|
Returns the target filename. |
|
Determines the extent to be exported. |
|
Returns |
|
Returns the selected format in which the export should be written. |
|
Returns the selected flat geometry type for the export. |
|
Determines if filtering the export by an extent is activated. |
|
Returns |
|
Returns the target layer name. |
|
Returns a list of additional layer options which are passed to OGR. |
|
Returns whether only selected features will be saved. |
|
Returns |
|
Returns the specified map scale. |
|
Returns a list of attributes which are selected for saving. |
|
Sets whether the "add to canvas" checkbox should be checked. |
|
Sets whether the force multi geometry checkbox should be checked. |
|
Sets whether the include z dimension checkbox should be checked. |
|
Sets a map canvas to associate with the dialog. |
|
Sets whether only selected features will be saved. |
|
Returns type of symbology export. |
- class qgis.gui.QgsVectorLayerSaveAsDialog[source]¶
Bases:
QDialog
- __init__(layer: QgsVectorLayer | None, options: QgsVectorLayerSaveAsDialog.Options | QgsVectorLayerSaveAsDialog.Option = QgsVectorLayerSaveAsDialog.Option.AllOptions, parent: QWidget | None = None, fl: Qt.WindowFlags | Qt.WindowType = Qt.WindowFlags())
Construct a new QgsVectorLayerSaveAsDialog
- Parameters:
layer (Optional[QgsVectorLayer])
options (Union[QgsVectorLayerSaveAsDialog.Options, QgsVectorLayerSaveAsDialog.Option] = QgsVectorLayerSaveAsDialog.Option.AllOptions)
parent (Optional[QWidget] = None)
fl (Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags())
- class Option(*values)¶
Bases:
IntEnum
Available dialog options.
Symbology
: Show symbology optionsDestinationCrs
: Show destination CRS (reprojection) optionFields
: Show field customization groupAddToCanvas
: Show add to map optionSelectedOnly
: Show selected features only optionGeometryType
: Show geometry groupExtent
: Show extent groupMetadata
: Show metadata optionsAllOptions
:
- AddToCanvas = 16¶
- AllOptions = -1¶
- DestinationCrs = 4¶
- Extent = 128¶
- Fields = 8¶
- GeometryType = 64¶
- Metadata = 256¶
- SelectedOnly = 32¶
- Symbology = 1¶
- class Options¶
- class Options(f: QgsVectorLayerSaveAsDialog.Options | QgsVectorLayerSaveAsDialog.Option)
- class Options(a0: QgsVectorLayerSaveAsDialog.Options)
Bases:
object
- addToCanvas(self) bool [source]¶
Returns
True
if the “add to canvas” checkbox is checked.See also
- Return type:
bool
- attributesAsDisplayedValues(self) List[int] [source]¶
Returns selected attributes that must be exported with their displayed values instead of their raw values.
- Return type:
List[int]
- attributesExportNames(self) List[str] [source]¶
Returns a list of export names for attributes.
- Return type:
List[str]
- automaticGeometryType(self) bool [source]¶
Returns
True
if geometry type is set to automatic.See also
- Return type:
bool
- creationActionOnExistingFile(self) QgsVectorFileWriter.ActionOnExistingFile [source]¶
Returns the creation action.
- Return type:
- crs(self) QgsCoordinateReferenceSystem [source]¶
Returns the CRS chosen for export.
Added in version 3.14.
- Return type:
- datasourceOptions(self) List[str] [source]¶
Returns a list of additional data source options which are passed to OGR. Refer to the OGR documentation for the target format for available options.
See also
- Return type:
List[str]
- filterExtent(self) QgsRectangle [source]¶
Determines the extent to be exported.
See also
- Return type:
- forceMulti(self) bool [source]¶
Returns
True
if force multi geometry type is checked.See also
See also
- Return type:
bool
- format(self) str [source]¶
Returns the selected format in which the export should be written.
See also
QgsVectorFileWriter.filterForDriver()
- Return type:
str
- geometryType(self) Qgis.WkbType [source]¶
Returns the selected flat geometry type for the export.
See also
See also
See also
- Return type:
- hasFilterExtent(self) bool [source]¶
Determines if filtering the export by an extent is activated.
See also
- Return type:
bool
- includeZ(self) bool [source]¶
Returns
True
if include z dimension is checked.See also
See also
- Return type:
bool
- layerOptions(self) List[str] [source]¶
Returns a list of additional layer options which are passed to OGR. Refer to the OGR documentation for the target format for available options.
See also
- Return type:
List[str]
- onlySelected(self) bool [source]¶
Returns whether only selected features will be saved.
See also
- Return type:
bool
- persistMetadata(self) bool [source]¶
Returns
True
if the persist metadata (copy source metadata to destination layer) option is checked.Added in version 3.20.
- Return type:
bool
- scale(self) float [source]¶
Returns the specified map scale. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
- Return type:
float
- selectedAttributes(self) List[int] [source]¶
Returns a list of attributes which are selected for saving.
- Return type:
List[int]
- setAddToCanvas(self, checked: bool)[source]¶
Sets whether the “add to canvas” checkbox should be
checked
.See also
Added in version 3.6.
- Parameters:
checked (bool)
- setForceMulti(self, checked: bool)[source]¶
Sets whether the force multi geometry checkbox should be checked.
See also
- Parameters:
checked (bool)
- setIncludeZ(self, checked: bool)[source]¶
Sets whether the include z dimension checkbox should be checked.
See also
- Parameters:
checked (bool)
- setMapCanvas(self, canvas: QgsMapCanvas | None)[source]¶
Sets a map
canvas
to associate with the dialog.- Parameters:
canvas (Optional[QgsMapCanvas])
- setOnlySelected(self, onlySelected: bool)[source]¶
Sets whether only selected features will be saved.
See also
- Parameters:
onlySelected (bool)
- symbologyExport(self) Qgis.FeatureSymbologyExport [source]¶
Returns type of symbology export.
- Return type: