forked from zsiki/bulkvectorexport
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbulkvectorexportdialog.py
More file actions
57 lines (49 loc) · 2.34 KB
/
Copy pathbulkvectorexportdialog.py
File metadata and controls
57 lines (49 loc) · 2.34 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
# -*- coding: utf-8 -*-
"""
/***************************************************************************
BulkVectorExportDialog
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from builtins import str
from qgis.PyQt import QtCore, QtGui, QtWidgets
from .ui_bulkvectorexport import Ui_BulkVectorExportDialog
from osgeo import ogr
class BulkVectorExportDialog(QtWidgets.QDialog):
def __init__(self):
QtWidgets.QDialog.__init__(self)
# Set up the user interface from Designer.
self.ui = Ui_BulkVectorExportDialog()
self.ui.setupUi(self)
# dir button push event
self.ui.dirButton.clicked.connect(self.getDir)
self.unsupportedDriverList = ['Memory', 'PostgreSQL', 'MySQL', 'ODBC', \
'S57']
self.ui.compression_no.toggled.connect(self.update_compression)
self.ui.compression_lzw.toggled.connect(self.update_compression)
self.ui.compression_jpeg.toggled.connect(self.update_compression)
def getDir(self):
dirName = str(QtWidgets.QFileDialog.getExistingDirectory(self, "Select Directory"))
self.ui.dirEdit.setText(dirName)
def update_compression(self, checked):
if not checked:
return
if self.ui.compression_no.isChecked():
tiffCompression = 'COMPRESS=NONE'
print(tiffCompression)
return tiffCompression
if self.ui.compression_lzw.isChecked():
tiffCompression = 'COMPRESS=DEFLATE'
print(tiffCompression)
return tiffCompression
if self.ui.compression_jpeg.isChecked():
tiffCompression = 'COMPRESS=JPEG'
print(tiffCompression)
return tiffCompression