applying patch from ticket #1714: adds option to perform geoprocessing and basic statistics functions on selected features

git-svn-id: http://svn.osgeo.org/qgis/trunk@10849 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
cfarmer 2009-05-26 18:07:37 +00:00
parent d37aae28a6
commit f13f45e813
7 changed files with 1097 additions and 457 deletions

File diff suppressed because it is too large Load Diff

View File

@ -38,31 +38,42 @@ class VisualDialog( QDialog, Ui_Dialog ):
if inputLayer != "": if inputLayer != "":
changedLayer = ftools_utils.getVectorLayerByName( inputLayer ) changedLayer = ftools_utils.getVectorLayerByName( inputLayer )
changedField = changedLayer.dataProvider().fields() changedField = changedLayer.dataProvider().fields()
# for Basic statistics (with or without selection)
if self.myFunction == 3:
if changedLayer.selectedFeatureCount() != 0:
self.useSelected.setCheckState( Qt.Checked )
else:
self.useSelected.setCheckState( Qt.Unchecked )
# add all fields in combobox because now we can work with text fields too
for i in changedField: for i in changedField:
if self.myFunction == 3: if self.myFunction == 3:
if changedField[i].type() == QVariant.Int or changedField[i].type() == QVariant.Double: if changedField[i].type() == QVariant.Int or changedField[i].type() == QVariant.Double:
self.cmbField.addItem( unicode( changedField[i].name() ) ) self.cmbField.addItem( unicode( changedField[i].name() ) )
else: else:
self.cmbField.addItem( unicode( changedField[i].name() ) ) self.cmbField.addItem( unicode( changedField[i].name() ) )
self.cmbField.addItem( unicode( changedField[i].name() ) )
def accept( self ): def accept( self ):
if self.inShape.currentText() == "": if self.inShape.currentText() == "":
QMessageBox.information( self, "Error!", self.tr( "Please specify input vector layer" ) ) QMessageBox.information( self, "Error!", self.tr( "Please specify input vector layer" ) )
elif self.cmbField.isVisible() and self.cmbField.currentText() == "": elif self.cmbField.isVisible() and self.cmbField.currentText() == "":
QMessageBox.information( self, "Error!", self.tr( "Please specify input field" ) ) QMessageBox.information( self, "Error!", self.tr( "Please specify input field" ) )
else: else:
self.visual( self.inShape.currentText(), self.cmbField.currentText() ) self.visual( self.inShape.currentText(), self.cmbField.currentText(), self.useSelected.checkState() )
def manageGui( self ): def manageGui( self ):
if self.myFunction == 1: # Check geometry validity if self.myFunction == 1: # Check geometry validity
self.setWindowTitle( self.tr( "Check geometry validity" ) ) self.setWindowTitle( self.tr( "Check geometry validity" ) )
self.cmbField.setVisible( False ) self.cmbField.setVisible( False )
self.label.setVisible( False ) self.label.setVisible( False )
self.useSelected.setVisible( False )
self.label_2.setText( self.tr( "Geometry errors" ) ) self.label_2.setText( self.tr( "Geometry errors" ) )
self.label_4.setText( self.tr( "Total encountered errors" ) ) self.label_4.setText( self.tr( "Total encountered errors" ) )
elif self.myFunction == 2: # List unique values elif self.myFunction == 2: # List unique values
self.setWindowTitle( self.tr( "List unique values" ) ) self.setWindowTitle( self.tr( "List unique values" ) )
self.label_2.setText( self.tr( "Unique values" ) ) self.label_2.setText( self.tr( "Unique values" ) )
self.label_4.setText(self.tr( "Total unique values" ) ) self.label_4.setText(self.tr( "Total unique values" ) )
self.useSelected.setVisible( False )
elif self.myFunction == 3: # Basic statistics elif self.myFunction == 3: # Basic statistics
self.setWindowTitle( self.tr( "Basics statistics" ) ) self.setWindowTitle( self.tr( "Basics statistics" ) )
self.label_2.setText( self.tr( "Statistics output" ) ) self.label_2.setText( self.tr( "Statistics output" ) )
@ -73,6 +84,7 @@ class VisualDialog( QDialog, Ui_Dialog ):
self.setWindowTitle( self.tr( "Nearest neighbour analysis" ) ) self.setWindowTitle( self.tr( "Nearest neighbour analysis" ) )
self.cmbField.setVisible( False ) self.cmbField.setVisible( False )
self.label.setVisible( False ) self.label.setVisible( False )
self.useSelected.setVisible( False )
self.label_2.setText( self.tr( "Nearest neighbour statistics" ) ) self.label_2.setText( self.tr( "Nearest neighbour statistics" ) )
self.label_4.setVisible( False ) self.label_4.setVisible( False )
self.lstCount.setVisible( False ) self.lstCount.setVisible( False )
@ -91,11 +103,11 @@ class VisualDialog( QDialog, Ui_Dialog ):
#2: List unique values #2: List unique values
#3: Basic statistics #3: Basic statistics
#4: Nearest neighbour analysis #4: Nearest neighbour analysis
def visual( self, myLayer, myField ): def visual( self, myLayer, myField, mySelection ):
vlayer = ftools_utils.getVectorLayerByName( myLayer ) vlayer = ftools_utils.getVectorLayerByName( myLayer )
self.lstUnique.clear() self.lstUnique.clear()
self.lstCount.clear() self.lstCount.clear()
self.testThread = visualThread( self.iface.mainWindow(), self, self.myFunction, vlayer, myField ) self.testThread = visualThread( self.iface.mainWindow(), self, self.myFunction, vlayer, myField, mySelection )
QObject.connect( self.testThread, SIGNAL( "runFinished(PyQt_PyObject)" ), self.runFinishedFromThread ) QObject.connect( self.testThread, SIGNAL( "runFinished(PyQt_PyObject)" ), self.runFinishedFromThread )
QObject.connect( self.testThread, SIGNAL( "runStatus(PyQt_PyObject)" ), self.runStatusFromThread ) QObject.connect( self.testThread, SIGNAL( "runStatus(PyQt_PyObject)" ), self.runStatusFromThread )
QObject.connect( self.testThread, SIGNAL( "runRange(PyQt_PyObject)" ), self.runRangeFromThread ) QObject.connect( self.testThread, SIGNAL( "runRange(PyQt_PyObject)" ), self.runRangeFromThread )
@ -122,13 +134,14 @@ class VisualDialog( QDialog, Ui_Dialog ):
self.progressBar.setRange( range_vals[ 0 ], range_vals[ 1 ] ) self.progressBar.setRange( range_vals[ 0 ], range_vals[ 1 ] )
class visualThread( QThread ): class visualThread( QThread ):
def __init__( self, parentThread, parentObject, function, vlayer, myField ): def __init__( self, parentThread, parentObject, function, vlayer, myField, mySelection ):
QThread.__init__( self, parentThread ) QThread.__init__( self, parentThread )
self.parent = parentObject self.parent = parentObject
self.running = False self.running = False
self.myFunction = function self.myFunction = function
self.vlayer = vlayer self.vlayer = vlayer
self.myField = myField self.myField = myField
self.mySelection = mySelection
# self.total = 0 # self.total = 0
# self.currentCount = 0 # self.currentCount = 0
@ -176,46 +189,127 @@ class visualThread( QThread ):
feat = QgsFeature() feat = QgsFeature()
sumVal = 0.0 sumVal = 0.0
meanVal = 0.0 meanVal = 0.0
stdVal = 0.0
cvVal = 0.0
nVal = 0.0 nVal = 0.0
values = [] values = []
first = True first = True
nFeat = vprovider.featureCount()
nElement = 0 nElement = 0
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 ) # determine selected field type
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) ) if ftools_utils.getFieldType( vlayer, myField ) == 'String':
while vprovider.nextFeature( feat ): fillVal = 0
atMap = feat.attributeMap() emptyVal = 0
value = float( atMap[ index ].toDouble()[ 0 ] ) if self.mySelection: # only selected features
if first: selection = vlayer.selectedFeatures()
minVal = value nFeat = vlayer.selectedFeatureCount()
maxVal = value self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
first = False self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
else: for f in selection:
if value < minVal: minVal = value atMap = f.attributeMap()
if value > maxVal: maxVal = value lenVal = float( len( atMap[ index ].toString() ) )
values.append( value ) if first:
sumVal = float( sumVal + value ) minVal = lenVal
nElement += 1 maxVal = lenVal
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement ) first = False
nVal= float( len( values ) ) else:
if nVal > 0.00: if lenVal < minVal: minVal = lenVal
meanVal = float( sumVal ) / nVal if lenVal > maxVal: maxVal = lenVal
if not meanVal == 0.00: if lenVal != 0.00:
for val in values: fillVal += 1
stdVal += float( ( val - meanVal ) * ( val - meanVal ) ) else:
stdVal = float( math.sqrt( stdVal / nVal ) ) emptyVal += 1
cvVal = float( stdVal / meanVal ) values.append( lenVal )
lstStats = [] sumVal = sumVal + lenVal
lstStats.append( "Mean : " + unicode( meanVal ) ) nElement += 1
lstStats.append( "StdDev : " + unicode( stdVal ) ) self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
lstStats.append( "Sum : " + unicode( sumVal) ) else: # there is no selection, process the whole layer
lstStats.append( "Min : " + unicode( minVal ) ) nFeat = vprovider.featureCount()
lstStats.append( "Max : " + unicode( maxVal ) ) self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
lstStats.append( "N : " + unicode( nVal ) ) self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
lstStats.append( "CV : " + unicode( cvVal ) ) while vprovider.nextFeature( feat ):
return ( lstStats, [] ) atMap = feat.attributeMap()
lenVal = float( len( atMap[ index ].toString() ) )
if first:
minVal = lenVal
maxVal = lenVal
first = False
else:
if lenVal < minVal: minVal = lenVal
if lenVal > maxVal: maxVal = lenVal
if lenVal != 0.00:
fillVal += 1
else:
emptyVal += 1
values.append( lenVal )
sumVal = sumVal + lenVal
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
nVal= float( len( values ) )
if nVal > 0.00:
meanVal = sumVal / nVal
lstStats = []
lstStats.append( QCoreApplication.translate( "statResult", "Max. len. : " ) + unicode( maxVal ) )
lstStats.append( QCoreApplication.translate( "statResult", "Min. len. : " ) + unicode( minVal ) )
lstStats.append( QCoreApplication.translate( "statResult", "Mean. len : " ) + unicode( meanVal ) )
lstStats.append( QCoreApplication.translate( "statResult", "Filled : " ) + unicode( fillVal ) )
lstStats.append( QCoreApplication.translate( "statResult", "Empty : " ) + unicode( emptyVal ) )
lstStats.append( QCoreApplication.translate( "statResult", "N : " ) + unicode( nVal ) )
return ( lstStats, [] )
else: # numeric field
stdVal = 0
cvVal = 0
if self.mySelection: # only selected features
selection = vlayer.selectedFeatures()
nFeat = vlayer.selectedFeatureCount()
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
for f in selection:
atMap = f.attributeMap()
value = float( atMap[ index ].toDouble()[ 0 ] )
if first:
minVal = value
maxVal = value
first = False
else:
if value < minVal: minVal = value
if value > maxVal: maxVal = value
values.append( value )
sumVal = sumVal + value
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
else: # there is no selection, process the whole layer
nFeat = vprovider.featureCount()
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
while vprovider.nextFeature( feat ):
atMap = feat.attributeMap()
value = float( atMap[ index ].toDouble()[ 0 ] )
if first:
minVal = value
maxVal = value
first = False
else:
if value < minVal: minVal = value
if value > maxVal: maxVal = value
values.append( value )
sumVal = sumVal + value
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
nVal= float( len( values ) )
if nVal > 0.00:
meanVal = sumVal / nVal
if meanVal != 0.00:
for val in values:
stdVal += ( ( val - meanVal ) * ( val - meanVal ) )
stdVal = math.sqrt( stdVal / nVal )
cvVal = stdVal / meanVal
lstStats = []
lstStats.append( "Mean : " + unicode( meanVal ) )
lstStats.append( "StdDev : " + unicode( stdVal ) )
lstStats.append( "Sum : " + unicode( sumVal) )
lstStats.append( "Min : " + unicode( minVal ) )
lstStats.append( "Max : " + unicode( maxVal ) )
lstStats.append( "N : " + unicode( nVal ) )
lstStats.append( "CV : " + unicode( cvVal ) )
return ( lstStats, [] )
def nearest_neighbour_analysis( self, vlayer ): def nearest_neighbour_analysis( self, vlayer ):
vprovider = vlayer.dataProvider() vprovider = vlayer.dataProvider()

View File

@ -2,8 +2,8 @@
# Form implementation generated from reading ui file 'frmGeoprocessing.ui' # Form implementation generated from reading ui file 'frmGeoprocessing.ui'
# #
# Created: Thu Nov 13 23:17:35 2008 # Created: Tue May 26 19:00:00 2009
# by: PyQt4 UI code generator 4.3.3 # by: PyQt4 UI code generator 4.4.4
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
@ -12,69 +12,54 @@ from PyQt4 import QtCore, QtGui
class Ui_Dialog(object): class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName("Dialog") Dialog.setObjectName("Dialog")
Dialog.resize(QtCore.QSize(QtCore.QRect(0,0,422,405).size()).expandedTo(Dialog.minimumSizeHint())) Dialog.resize(422, 405)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
Dialog.setSizePolicy(sizePolicy) Dialog.setSizePolicy(sizePolicy)
self.gridLayout = QtGui.QGridLayout(Dialog)
self.gridlayout = QtGui.QGridLayout(Dialog) self.gridLayout.setObjectName("gridLayout")
self.gridlayout.setObjectName("gridlayout")
self.vboxlayout = QtGui.QVBoxLayout() self.vboxlayout = QtGui.QVBoxLayout()
self.vboxlayout.setObjectName("vboxlayout") self.vboxlayout.setObjectName("vboxlayout")
self.label_1 = QtGui.QLabel(Dialog) self.label_1 = QtGui.QLabel(Dialog)
self.label_1.setObjectName("label_1") self.label_1.setObjectName("label_1")
self.vboxlayout.addWidget(self.label_1) self.vboxlayout.addWidget(self.label_1)
self.inShapeA = QtGui.QComboBox(Dialog) self.inShapeA = QtGui.QComboBox(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.inShapeA.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.inShapeA.sizePolicy().hasHeightForWidth())
self.inShapeA.setSizePolicy(sizePolicy) self.inShapeA.setSizePolicy(sizePolicy)
self.inShapeA.setObjectName("inShapeA") self.inShapeA.setObjectName("inShapeA")
self.vboxlayout.addWidget(self.inShapeA) self.vboxlayout.addWidget(self.inShapeA)
self.gridlayout.addLayout(self.vboxlayout,0,0,1,2) self.gridLayout.addLayout(self.vboxlayout, 0, 0, 1, 2)
self.vboxlayout1 = QtGui.QVBoxLayout() self.vboxlayout1 = QtGui.QVBoxLayout()
self.vboxlayout1.setObjectName("vboxlayout1") self.vboxlayout1.setObjectName("vboxlayout1")
self.label_2 = QtGui.QLabel(Dialog) self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setObjectName("label_2") self.label_2.setObjectName("label_2")
self.vboxlayout1.addWidget(self.label_2) self.vboxlayout1.addWidget(self.label_2)
self.inShapeB = QtGui.QComboBox(Dialog) self.inShapeB = QtGui.QComboBox(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.inShapeB.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.inShapeB.sizePolicy().hasHeightForWidth())
self.inShapeB.setSizePolicy(sizePolicy) self.inShapeB.setSizePolicy(sizePolicy)
self.inShapeB.setObjectName("inShapeB") self.inShapeB.setObjectName("inShapeB")
self.vboxlayout1.addWidget(self.inShapeB) self.vboxlayout1.addWidget(self.inShapeB)
self.gridlayout.addLayout(self.vboxlayout1,1,0,1,2) self.gridLayout.addLayout(self.vboxlayout1, 3, 0, 1, 2)
self.hboxlayout = QtGui.QHBoxLayout() self.hboxlayout = QtGui.QHBoxLayout()
self.hboxlayout.setObjectName("hboxlayout") self.hboxlayout.setObjectName("hboxlayout")
self.hboxlayout1 = QtGui.QHBoxLayout() self.hboxlayout1 = QtGui.QHBoxLayout()
self.hboxlayout1.setObjectName("hboxlayout1") self.hboxlayout1.setObjectName("hboxlayout1")
self.rdoBuffer = QtGui.QRadioButton(Dialog) self.rdoBuffer = QtGui.QRadioButton(Dialog)
self.rdoBuffer.setChecked(True) self.rdoBuffer.setChecked(True)
self.rdoBuffer.setObjectName("rdoBuffer") self.rdoBuffer.setObjectName("rdoBuffer")
self.hboxlayout1.addWidget(self.rdoBuffer) self.hboxlayout1.addWidget(self.rdoBuffer)
self.hboxlayout.addLayout(self.hboxlayout1) self.hboxlayout.addLayout(self.hboxlayout1)
self.param = QtGui.QLineEdit(Dialog) self.param = QtGui.QLineEdit(Dialog)
self.param.setEnabled(True) self.param.setEnabled(True)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.param.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.param.sizePolicy().hasHeightForWidth())
@ -83,90 +68,85 @@ class Ui_Dialog(object):
self.param.setCursorPosition(0) self.param.setCursorPosition(0)
self.param.setObjectName("param") self.param.setObjectName("param")
self.hboxlayout.addWidget(self.param) self.hboxlayout.addWidget(self.param)
self.gridlayout.addLayout(self.hboxlayout,2,0,1,2) self.gridLayout.addLayout(self.hboxlayout, 5, 0, 1, 2)
self.vboxlayout2 = QtGui.QVBoxLayout() self.vboxlayout2 = QtGui.QVBoxLayout()
self.vboxlayout2.setObjectName("vboxlayout2") self.vboxlayout2.setObjectName("vboxlayout2")
self.hboxlayout2 = QtGui.QHBoxLayout() self.hboxlayout2 = QtGui.QHBoxLayout()
self.hboxlayout2.setObjectName("hboxlayout2") self.hboxlayout2.setObjectName("hboxlayout2")
self.rdoField = QtGui.QRadioButton(Dialog) self.rdoField = QtGui.QRadioButton(Dialog)
self.rdoField.setObjectName("rdoField") self.rdoField.setObjectName("rdoField")
self.hboxlayout2.addWidget(self.rdoField) self.hboxlayout2.addWidget(self.rdoField)
self.label_4 = QtGui.QLabel(Dialog) self.label_4 = QtGui.QLabel(Dialog)
self.label_4.setObjectName("label_4") self.label_4.setObjectName("label_4")
self.hboxlayout2.addWidget(self.label_4) self.hboxlayout2.addWidget(self.label_4)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
spacerItem = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
self.hboxlayout2.addItem(spacerItem) self.hboxlayout2.addItem(spacerItem)
self.vboxlayout2.addLayout(self.hboxlayout2) self.vboxlayout2.addLayout(self.hboxlayout2)
self.attrib = QtGui.QComboBox(Dialog) self.attrib = QtGui.QComboBox(Dialog)
self.attrib.setEnabled(False) self.attrib.setEnabled(False)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.attrib.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.attrib.sizePolicy().hasHeightForWidth())
self.attrib.setSizePolicy(sizePolicy) self.attrib.setSizePolicy(sizePolicy)
self.attrib.setObjectName("attrib") self.attrib.setObjectName("attrib")
self.vboxlayout2.addWidget(self.attrib) self.vboxlayout2.addWidget(self.attrib)
self.gridlayout.addLayout(self.vboxlayout2,3,0,1,2) self.gridLayout.addLayout(self.vboxlayout2, 6, 0, 1, 2)
self.hboxlayout3 = QtGui.QHBoxLayout() self.hboxlayout3 = QtGui.QHBoxLayout()
self.hboxlayout3.setSpacing(6) self.hboxlayout3.setSpacing(6)
self.hboxlayout3.setMargin(0) self.hboxlayout3.setMargin(0)
self.hboxlayout3.setObjectName("hboxlayout3") self.hboxlayout3.setObjectName("hboxlayout3")
self.mergeOutput = QtGui.QCheckBox(Dialog) self.mergeOutput = QtGui.QCheckBox(Dialog)
self.mergeOutput.setEnabled(True) self.mergeOutput.setEnabled(True)
self.mergeOutput.setObjectName("mergeOutput") self.mergeOutput.setObjectName("mergeOutput")
self.hboxlayout3.addWidget(self.mergeOutput) self.hboxlayout3.addWidget(self.mergeOutput)
self.gridlayout.addLayout(self.hboxlayout3,4,0,1,1) self.gridLayout.addLayout(self.hboxlayout3, 7, 0, 1, 1)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
spacerItem1 = QtGui.QSpacerItem(20,40,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem1, 8, 0, 1, 1)
self.gridlayout.addItem(spacerItem1,5,0,1,1)
self.vboxlayout3 = QtGui.QVBoxLayout() self.vboxlayout3 = QtGui.QVBoxLayout()
self.vboxlayout3.setObjectName("vboxlayout3") self.vboxlayout3.setObjectName("vboxlayout3")
self.label_5 = QtGui.QLabel(Dialog) self.label_5 = QtGui.QLabel(Dialog)
self.label_5.setObjectName("label_5") self.label_5.setObjectName("label_5")
self.vboxlayout3.addWidget(self.label_5) self.vboxlayout3.addWidget(self.label_5)
self.hboxlayout4 = QtGui.QHBoxLayout() self.hboxlayout4 = QtGui.QHBoxLayout()
self.hboxlayout4.setObjectName("hboxlayout4") self.hboxlayout4.setObjectName("hboxlayout4")
self.outShape = QtGui.QLineEdit(Dialog) self.outShape = QtGui.QLineEdit(Dialog)
self.outShape.setReadOnly(True) self.outShape.setReadOnly(True)
self.outShape.setObjectName("outShape") self.outShape.setObjectName("outShape")
self.hboxlayout4.addWidget(self.outShape) self.hboxlayout4.addWidget(self.outShape)
self.btnBrowse = QtGui.QPushButton(Dialog) self.btnBrowse = QtGui.QPushButton(Dialog)
self.btnBrowse.setObjectName("btnBrowse") self.btnBrowse.setObjectName("btnBrowse")
self.hboxlayout4.addWidget(self.btnBrowse) self.hboxlayout4.addWidget(self.btnBrowse)
self.vboxlayout3.addLayout(self.hboxlayout4) self.vboxlayout3.addLayout(self.hboxlayout4)
self.gridlayout.addLayout(self.vboxlayout3,6,0,1,2) self.gridLayout.addLayout(self.vboxlayout3, 9, 0, 1, 2)
self.progressBar = QtGui.QProgressBar(Dialog) self.progressBar = QtGui.QProgressBar(Dialog)
self.progressBar.setProperty("value",QtCore.QVariant(0)) self.progressBar.setProperty("value", QtCore.QVariant(0))
self.progressBar.setAlignment(QtCore.Qt.AlignCenter) self.progressBar.setAlignment(QtCore.Qt.AlignCenter)
self.progressBar.setOrientation(QtCore.Qt.Horizontal) self.progressBar.setOrientation(QtCore.Qt.Horizontal)
self.progressBar.setObjectName("progressBar") self.progressBar.setObjectName("progressBar")
self.gridlayout.addWidget(self.progressBar,7,0,1,1) self.gridLayout.addWidget(self.progressBar, 10, 0, 1, 1)
self.buttonBox_2 = QtGui.QDialogButtonBox(Dialog) self.buttonBox_2 = QtGui.QDialogButtonBox(Dialog)
self.buttonBox_2.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.Ok) self.buttonBox_2.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.Ok)
self.buttonBox_2.setObjectName("buttonBox_2") self.buttonBox_2.setObjectName("buttonBox_2")
self.gridlayout.addWidget(self.buttonBox_2,7,1,1,1) self.gridLayout.addWidget(self.buttonBox_2, 10, 1, 1, 1)
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.useSelectedA = QtGui.QCheckBox(Dialog)
self.useSelectedA.setObjectName("useSelectedA")
self.verticalLayout.addWidget(self.useSelectedA)
self.gridLayout.addLayout(self.verticalLayout, 2, 0, 1, 1)
self.verticalLayout_2 = QtGui.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.useSelectedB = QtGui.QCheckBox(Dialog)
self.useSelectedB.setObjectName("useSelectedB")
self.verticalLayout_2.addWidget(self.useSelectedB)
self.gridLayout.addLayout(self.verticalLayout_2, 4, 0, 1, 1)
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
QtCore.QObject.connect(self.rdoField,QtCore.SIGNAL("toggled(bool)"),self.attrib.setEnabled) QtCore.QObject.connect(self.rdoField, QtCore.SIGNAL("toggled(bool)"), self.attrib.setEnabled)
QtCore.QObject.connect(self.rdoBuffer,QtCore.SIGNAL("toggled(bool)"),self.param.setEnabled) QtCore.QObject.connect(self.rdoBuffer, QtCore.SIGNAL("toggled(bool)"), self.param.setEnabled)
QtCore.QObject.connect(self.buttonBox_2,QtCore.SIGNAL("rejected()"),Dialog.reject) QtCore.QObject.connect(self.buttonBox_2, QtCore.SIGNAL("rejected()"), Dialog.reject)
QtCore.QObject.connect(self.buttonBox_2,QtCore.SIGNAL("accepted()"),Dialog.accept) QtCore.QObject.connect(self.buttonBox_2, QtCore.SIGNAL("accepted()"), Dialog.accept)
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog): def retranslateUi(self, Dialog):
@ -179,4 +159,6 @@ class Ui_Dialog(object):
self.mergeOutput.setText(QtGui.QApplication.translate("Dialog", "Dissolve buffer results", None, QtGui.QApplication.UnicodeUTF8)) self.mergeOutput.setText(QtGui.QApplication.translate("Dialog", "Dissolve buffer results", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("Dialog", "Output shapefile", None, QtGui.QApplication.UnicodeUTF8)) self.label_5.setText(QtGui.QApplication.translate("Dialog", "Output shapefile", None, QtGui.QApplication.UnicodeUTF8))
self.btnBrowse.setText(QtGui.QApplication.translate("Dialog", "Browse", None, QtGui.QApplication.UnicodeUTF8)) self.btnBrowse.setText(QtGui.QApplication.translate("Dialog", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.useSelectedA.setText(QtGui.QApplication.translate("Dialog", "Use only selected features", None, QtGui.QApplication.UnicodeUTF8))
self.useSelectedB.setText(QtGui.QApplication.translate("Dialog", "Use only selected features", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -40,7 +40,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0" colspan="2" > <item row="3" column="0" colspan="2" >
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<item> <item>
<widget class="QLabel" name="label_2" > <widget class="QLabel" name="label_2" >
@ -61,7 +61,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="0" colspan="2" > <item row="5" column="0" colspan="2" >
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<item> <item>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
@ -101,7 +101,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0" colspan="2" > <item row="6" column="0" colspan="2" >
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<item> <item>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
@ -149,7 +149,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="0" > <item row="7" column="0" >
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
@ -169,7 +169,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="5" column="0" > <item row="8" column="0" >
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -182,7 +182,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="6" column="0" colspan="2" > <item row="9" column="0" colspan="2" >
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<item> <item>
<widget class="QLabel" name="label_5" > <widget class="QLabel" name="label_5" >
@ -211,7 +211,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="7" column="0" > <item row="10" column="0" >
<widget class="QProgressBar" name="progressBar" > <widget class="QProgressBar" name="progressBar" >
<property name="value" > <property name="value" >
<number>0</number> <number>0</number>
@ -224,13 +224,35 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1" > <item row="10" column="1" >
<widget class="QDialogButtonBox" name="buttonBox_2" > <widget class="QDialogButtonBox" name="buttonBox_2" >
<property name="standardButtons" > <property name="standardButtons" >
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" >
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QCheckBox" name="useSelectedA" >
<property name="text" >
<string>Use only selected features</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" >
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QCheckBox" name="useSelectedB" >
<property name="text" >
<string>Use only selected features</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>

View File

@ -2,8 +2,8 @@
# Form implementation generated from reading ui file 'frmVisual.ui' # Form implementation generated from reading ui file 'frmVisual.ui'
# #
# Created: Tue Apr 21 15:10:47 2009 # Created: Tue May 26 18:55:54 2009
# by: PyQt4 UI code generator 4.4.3 # by: PyQt4 UI code generator 4.4.4
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
@ -13,7 +13,7 @@ class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName("Dialog") Dialog.setObjectName("Dialog")
Dialog.setWindowModality(QtCore.Qt.NonModal) Dialog.setWindowModality(QtCore.Qt.NonModal)
Dialog.resize(374, 485) Dialog.resize(404, 485)
Dialog.setSizeGripEnabled(True) Dialog.setSizeGripEnabled(True)
self.gridLayout = QtGui.QGridLayout(Dialog) self.gridLayout = QtGui.QGridLayout(Dialog)
self.gridLayout.setObjectName("gridLayout") self.gridLayout.setObjectName("gridLayout")
@ -34,7 +34,7 @@ class Ui_Dialog(object):
self.cmbField = QtGui.QComboBox(Dialog) self.cmbField = QtGui.QComboBox(Dialog)
self.cmbField.setObjectName("cmbField") self.cmbField.setObjectName("cmbField")
self.vboxlayout1.addWidget(self.cmbField) self.vboxlayout1.addWidget(self.cmbField)
self.gridLayout.addLayout(self.vboxlayout1, 1, 0, 1, 2) self.gridLayout.addLayout(self.vboxlayout1, 4, 0, 1, 2)
self.vboxlayout2 = QtGui.QVBoxLayout() self.vboxlayout2 = QtGui.QVBoxLayout()
self.vboxlayout2.setObjectName("vboxlayout2") self.vboxlayout2.setObjectName("vboxlayout2")
self.label_2 = QtGui.QLabel(Dialog) self.label_2 = QtGui.QLabel(Dialog)
@ -49,7 +49,7 @@ class Ui_Dialog(object):
self.lstUnique.setSelectionRectVisible(True) self.lstUnique.setSelectionRectVisible(True)
self.lstUnique.setObjectName("lstUnique") self.lstUnique.setObjectName("lstUnique")
self.vboxlayout2.addWidget(self.lstUnique) self.vboxlayout2.addWidget(self.lstUnique)
self.gridLayout.addLayout(self.vboxlayout2, 2, 0, 1, 2) self.gridLayout.addLayout(self.vboxlayout2, 5, 0, 1, 2)
self.hboxlayout = QtGui.QHBoxLayout() self.hboxlayout = QtGui.QHBoxLayout()
self.hboxlayout.setObjectName("hboxlayout") self.hboxlayout.setObjectName("hboxlayout")
self.label_4 = QtGui.QLabel(Dialog) self.label_4 = QtGui.QLabel(Dialog)
@ -59,17 +59,23 @@ class Ui_Dialog(object):
self.lstCount.setReadOnly(True) self.lstCount.setReadOnly(True)
self.lstCount.setObjectName("lstCount") self.lstCount.setObjectName("lstCount")
self.hboxlayout.addWidget(self.lstCount) self.hboxlayout.addWidget(self.lstCount)
self.gridLayout.addLayout(self.hboxlayout, 3, 0, 1, 2) self.gridLayout.addLayout(self.hboxlayout, 6, 0, 1, 2)
self.progressBar = QtGui.QProgressBar(Dialog) self.progressBar = QtGui.QProgressBar(Dialog)
self.progressBar.setProperty("value", QtCore.QVariant(24)) self.progressBar.setProperty("value", QtCore.QVariant(24))
self.progressBar.setAlignment(QtCore.Qt.AlignCenter) self.progressBar.setAlignment(QtCore.Qt.AlignCenter)
self.progressBar.setObjectName("progressBar") self.progressBar.setObjectName("progressBar")
self.gridLayout.addWidget(self.progressBar, 4, 0, 1, 1) self.gridLayout.addWidget(self.progressBar, 7, 0, 1, 1)
self.buttonBox_2 = QtGui.QDialogButtonBox(Dialog) self.buttonBox_2 = QtGui.QDialogButtonBox(Dialog)
self.buttonBox_2.setOrientation(QtCore.Qt.Horizontal) self.buttonBox_2.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox_2.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.Ok) self.buttonBox_2.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.Ok)
self.buttonBox_2.setObjectName("buttonBox_2") self.buttonBox_2.setObjectName("buttonBox_2")
self.gridLayout.addWidget(self.buttonBox_2, 4, 1, 1, 1) self.gridLayout.addWidget(self.buttonBox_2, 7, 1, 1, 1)
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.useSelected = QtGui.QCheckBox(Dialog)
self.useSelected.setObjectName("useSelected")
self.verticalLayout.addWidget(self.useSelected)
self.gridLayout.addLayout(self.verticalLayout, 3, 0, 1, 1)
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox_2, QtCore.SIGNAL("accepted()"), Dialog.accept) QtCore.QObject.connect(self.buttonBox_2, QtCore.SIGNAL("accepted()"), Dialog.accept)
@ -83,4 +89,5 @@ class Ui_Dialog(object):
self.label_2.setText(QtGui.QApplication.translate("Dialog", "Unique values list", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setText(QtGui.QApplication.translate("Dialog", "Unique values list", None, QtGui.QApplication.UnicodeUTF8))
self.lstUnique.setSortingEnabled(True) self.lstUnique.setSortingEnabled(True)
self.label_4.setText(QtGui.QApplication.translate("Dialog", "Unique value count", None, QtGui.QApplication.UnicodeUTF8)) self.label_4.setText(QtGui.QApplication.translate("Dialog", "Unique value count", None, QtGui.QApplication.UnicodeUTF8))
self.useSelected.setText(QtGui.QApplication.translate("Dialog", "Use only selected features", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -1,126 +1,138 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class> <class>Dialog</class>
<widget class="QDialog" name="Dialog" > <widget class="QDialog" name="Dialog">
<property name="windowModality" > <property name="windowModality">
<enum>Qt::NonModal</enum> <enum>Qt::NonModal</enum>
</property> </property>
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>374</width> <width>404</width>
<height>485</height> <height>485</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>List Unique Values</string> <string>List Unique Values</string>
</property> </property>
<property name="sizeGripEnabled" > <property name="sizeGripEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout" > <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2" > <item row="0" column="0" colspan="2">
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<item> <item>
<widget class="QLabel" name="label_3" > <widget class="QLabel" name="label_3">
<property name="text" > <property name="text">
<string>Input Vector Layer</string> <string>Input Vector Layer</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="inShape" /> <widget class="QComboBox" name="inShape"/>
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0" colspan="2" > <item row="4" column="0" colspan="2">
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<item> <item>
<widget class="QLabel" name="label" > <widget class="QLabel" name="label">
<property name="text" > <property name="text">
<string>Target field</string> <string>Target field</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="cmbField" /> <widget class="QComboBox" name="cmbField"/>
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="0" colspan="2" > <item row="5" column="0" colspan="2">
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<item> <item>
<widget class="QLabel" name="label_2" > <widget class="QLabel" name="label_2">
<property name="text" > <property name="text">
<string>Unique values list</string> <string>Unique values list</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QListWidget" name="lstUnique" > <widget class="QListWidget" name="lstUnique">
<property name="editTriggers" > <property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set> <set>QAbstractItemView::NoEditTriggers</set>
</property> </property>
<property name="showDropIndicator" stdset="0" > <property name="showDropIndicator" stdset="0">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="alternatingRowColors" > <property name="alternatingRowColors">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="selectionMode" > <property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum> <enum>QAbstractItemView::ExtendedSelection</enum>
</property> </property>
<property name="selectionBehavior" > <property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum> <enum>QAbstractItemView::SelectRows</enum>
</property> </property>
<property name="selectionRectVisible" > <property name="selectionRectVisible">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="sortingEnabled" > <property name="sortingEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0" colspan="2" > <item row="6" column="0" colspan="2">
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<item> <item>
<widget class="QLabel" name="label_4" > <widget class="QLabel" name="label_4">
<property name="text" > <property name="text">
<string>Unique value count</string> <string>Unique value count</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lstCount" > <widget class="QLineEdit" name="lstCount">
<property name="readOnly" > <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="0" > <item row="7" column="0">
<widget class="QProgressBar" name="progressBar" > <widget class="QProgressBar" name="progressBar">
<property name="value" > <property name="value">
<number>24</number> <number>24</number>
</property> </property>
<property name="alignment" > <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1" > <item row="7" column="1">
<widget class="QDialogButtonBox" name="buttonBox_2" > <widget class="QDialogButtonBox" name="buttonBox_2">
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="standardButtons" > <property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="useSelected">
<property name="text">
<string>Use only selected features</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
@ -131,11 +143,11 @@
<receiver>Dialog</receiver> <receiver>Dialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel">
<x>133</x> <x>133</x>
<y>276</y> <y>276</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel">
<x>215</x> <x>215</x>
<y>290</y> <y>290</y>
</hint> </hint>
@ -147,11 +159,11 @@
<receiver>Dialog</receiver> <receiver>Dialog</receiver>
<slot>close()</slot> <slot>close()</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel">
<x>59</x> <x>59</x>
<y>276</y> <y>276</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel">
<x>132</x> <x>132</x>
<y>239</y> <y>239</y>
</hint> </hint>

View File

@ -19,6 +19,7 @@
# addShapeToCanvas( QString *file path ) # addShapeToCanvas( QString *file path )
# getUniqueValues( QgsVectorDataProvider, int *field id ) # getUniqueValues( QgsVectorDataProvider, int *field id )
# saveDialog( QWidget *parent ) # saveDialog( QWidget *parent )
# getFieldType( QgsVectorLayer, QgsField.name() )
# #
# ------------------------------------------------- # -------------------------------------------------
@ -260,3 +261,9 @@ def saveDialog( parent ):
settings.setValue("/UI/lastShapefileDir", QVariant( QFileInfo( unicode( files.first() ) ).absolutePath() ) ) settings.setValue("/UI/lastShapefileDir", QVariant( QFileInfo( unicode( files.first() ) ).absolutePath() ) )
return ( unicode( files.first() ), unicode( fileDialog.encoding() ) ) return ( unicode( files.first() ), unicode( fileDialog.encoding() ) )
# Return field type from it's name
def getFieldType(vlayer, fieldName):
fields = vlayer.dataProvider().fields()
for name, field in fields.iteritems():
if field.name() == fieldName:
return field.typeName()