mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
allow multiple values in proximity tool,
allow multiple no-data values in warp tool, fixed error in retrieving srs git-svn-id: http://svn.osgeo.org/qgis/trunk@14938 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
96d75f856e
commit
8ab9d1d5b7
@ -1,6 +1,6 @@
|
||||
"""
|
||||
/***************************************************************************
|
||||
Name : GdalTools
|
||||
Name : GdalTools
|
||||
Description : Integrate gdal tools into qgis
|
||||
Date : 17/Sep/09
|
||||
copyright : (C) 2009 by Lorenzo Masini and Giuseppe Sucameli (Faunalia)
|
||||
@ -22,7 +22,7 @@ def name():
|
||||
def description():
|
||||
return "Integrate gdal tools into qgis"
|
||||
def version():
|
||||
return "Version 1.2.18"
|
||||
return "Version 1.2.19"
|
||||
def qgisMinimumVersion():
|
||||
return "1.0"
|
||||
def icon():
|
||||
|
@ -184,10 +184,12 @@ def getRasterSRS( parent, fileName ):
|
||||
arr = processSRS.readAllStandardOutput()
|
||||
processSRS.close()
|
||||
|
||||
if not arr.isEmpty():
|
||||
info = QString( arr ).split( "\n" ).filter( "AUTHORITY" )
|
||||
if info.count() == 0:
|
||||
return QString()
|
||||
if arr.isEmpty():
|
||||
return QString()
|
||||
|
||||
info = QString( arr ).split( "\n" ).filter( "AUTHORITY" )
|
||||
if info.count() == 0:
|
||||
return QString()
|
||||
|
||||
srs = info[ info.count() - 1 ]
|
||||
srs = srs.simplified().remove( "AUTHORITY[" )
|
||||
@ -294,7 +296,7 @@ class FileFilter:
|
||||
|
||||
# workaround for QGis < 1.5 (see #2376)
|
||||
# separates multiple extensions that joined by a slash
|
||||
if QGis.QGIS_VERSION[0:3] < "1.8":
|
||||
if QGis.QGIS_VERSION[0:3] < "1.5":
|
||||
formats = self.rastersFilter.split( ";;" )
|
||||
self.rastersFilter = QString()
|
||||
for f in formats:
|
||||
|
@ -26,7 +26,7 @@ class GdalToolsDialog(QWidget, Ui_Widget, BasePluginWidget):
|
||||
[
|
||||
(self.inputLayerCombo, [SIGNAL("currentIndexChanged(int)"), SIGNAL("editTextChanged(const QString &)")] ),
|
||||
(self.outputFileEdit, SIGNAL("textChanged(const QString &)")),
|
||||
([self.valueSpin1, self.valueSpin2, self.valueSpin3], SIGNAL("valueChanged(int)"), self.valuesCheck),
|
||||
(self.valuesEdit, SIGNAL("textChanged(const QString &)"), self.valuesCheck),
|
||||
(self.distUnitsCombo, SIGNAL("currentIndexChanged(int)"), self.distUnitsCheck),
|
||||
(self.maxDistSpin, SIGNAL("valueChanged(int)"), self.maxDistCheck),
|
||||
(self.noDataSpin, SIGNAL("valueChanged(int)"), self.noDataCheck),
|
||||
@ -73,8 +73,10 @@ class GdalToolsDialog(QWidget, Ui_Widget, BasePluginWidget):
|
||||
arguments << self.inputLayerCombo.currentText()
|
||||
arguments << self.outputFileEdit.text()
|
||||
if self.valuesCheck.isChecked():
|
||||
arguments << "-values"
|
||||
arguments << ",".join([str(self.valueSpin1.value()), str(self.valueSpin2.value()), str(self.valueSpin3.value())])
|
||||
values = self.valuesEdit.text().trimmed()
|
||||
if not values.isEmpty():
|
||||
arguments << "-values"
|
||||
arguments << values.replace(' ', ',')
|
||||
if self.distUnitsCheck.isChecked() and self.distUnitsCombo.currentIndex() >= 0:
|
||||
arguments << "-distunits"
|
||||
arguments << self.distUnitsCombo.currentText()
|
||||
|
@ -132,9 +132,16 @@ class GdalToolsDialog(QWidget, Ui_Widget, BaseBatchWidget):
|
||||
workDir = QDir( inputDir )
|
||||
workDir.setFilter( QDir.Files | QDir.NoSymLinks | QDir.NoDotAndDotDot )
|
||||
workDir.setNameFilters( filter )
|
||||
if workDir.entryList().count() > 0:
|
||||
fl = inputDir + "/" + workDir.entryList()[ 0 ]
|
||||
self.targetSRSEdit.setText( Utils.getRasterSRS( self, fl ) )
|
||||
|
||||
# search for a valid SRS, then use it as default target SRS
|
||||
srs = QString()
|
||||
for fname in workDir.entryList():
|
||||
fl = inputDir + "/" + fname
|
||||
srs = Utils.getRasterSRS( self, fl )
|
||||
if not srs.isEmpty():
|
||||
break
|
||||
self.targetSRSEdit.setText( srs )
|
||||
|
||||
|
||||
def fillOutputFileEdit(self):
|
||||
lastUsedFilter = Utils.FileFilter.lastUsedRasterFilter()
|
||||
|
@ -180,13 +180,11 @@ class GdalToolsDialog(QWidget, Ui_Widget, BaseBatchWidget):
|
||||
arguments << str( self.heightSpin.value() )
|
||||
if self.multithreadCheck.isChecked():
|
||||
arguments << "-multi"
|
||||
if self.noDataCheck.isChecked() and not self.noDataEdit.text().isEmpty():
|
||||
arguments << "-dstnodata"
|
||||
nd = self.noDataEdit.text().simplified()
|
||||
if nd.contains( " " ):
|
||||
arguments << '"' + nd + '"'
|
||||
else:
|
||||
arguments << nd
|
||||
if self.noDataCheck.isChecked():
|
||||
nodata = self.noDataEdit.text().trimmed()
|
||||
if not nodata.isEmpty():
|
||||
arguments << "-dstnodata"
|
||||
arguments << nodata
|
||||
if self.isBatchEnabled():
|
||||
return arguments
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>356</width>
|
||||
<height>257</height>
|
||||
<width>327</width>
|
||||
<height>253</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -90,31 +90,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="valueSpin1">
|
||||
<property name="maximum">
|
||||
<number>65000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="valueSpin2">
|
||||
<property name="maximum">
|
||||
<number>65000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="valueSpin3">
|
||||
<property name="maximum">
|
||||
<number>65000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="distUnitsCheck">
|
||||
<property name="text">
|
||||
@ -181,6 +156,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="valuesEdit">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -192,12 +192,16 @@
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="noDataCheck">
|
||||
<property name="text">
|
||||
<string>Set no data value</string>
|
||||
<string>No data values</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="noDataEdit"/>
|
||||
<widget class="QLineEdit" name="noDataEdit">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="cacheCheck">
|
||||
|
Loading…
x
Reference in New Issue
Block a user