-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathqgis-sample-QgsRasterLayerSaveAsDialog.py
44 lines (39 loc) · 1.69 KB
/
qgis-sample-QgsRasterLayerSaveAsDialog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# coding: utf-8
from qgis.gui import QgsRasterLayerSaveAsDialog
from qgis.utils import iface
layer = iface.activeLayer()
canvas = iface.mapCanvas()
canvas_crs = canvas.mapSettings().destinationCrs()
raster_layer_save_as_dialog = QgsRasterLayerSaveAsDialog(
layer,
layer.dataProvider(),
canvas.extent(),
layer.crs(),
canvas_crs
)
def on_accepted():
print("OK")
print(raster_layer_save_as_dialog.addToCanvas())
print(raster_layer_save_as_dialog.buildPyramidsFlag())
print(raster_layer_save_as_dialog.createOptions())
print(raster_layer_save_as_dialog.maximumTileSizeX())
print(raster_layer_save_as_dialog.maximumTileSizeY())
print(raster_layer_save_as_dialog.mode())
print(raster_layer_save_as_dialog.nColumns())
print(raster_layer_save_as_dialog.noData())
print(raster_layer_save_as_dialog.nRows())
print(raster_layer_save_as_dialog.outputCrs())
print(raster_layer_save_as_dialog.outputFileName())
print(raster_layer_save_as_dialog.outputFormat())
print(raster_layer_save_as_dialog.outputRectangle())
print(raster_layer_save_as_dialog.pyramidsConfigOptions())
print(raster_layer_save_as_dialog.pyramidsFormat())
print(raster_layer_save_as_dialog.pyramidsList())
print(raster_layer_save_as_dialog.pyramidsResamplingMethod())
print(raster_layer_save_as_dialog.tileMode())
print(raster_layer_save_as_dialog.xResolution())
print(raster_layer_save_as_dialog.yResolution())
# print(raster_layer_save_as_dialog.ideFormat()) # If you need to hide format
# print(raster_layer_save_as_dialog.hideOutput()) # If you need to hide output
raster_layer_save_as_dialog.accepted.connect(on_accepted)
raster_layer_save_as_dialog.show()