Skip to content

Commit

Permalink
fixed nodata max and min value
Browse files Browse the repository at this point in the history
corrected the spinboxes width
fixed issue using Arc/Info ASCII Grid as output format 


git-svn-id: http://svn.osgeo.org/qgis/trunk@14074 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Aug 13, 2010
1 parent 4a66f10 commit 62d1637
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 25 deletions.
15 changes: 13 additions & 2 deletions python/plugins/GdalTools/tools/GdalTools_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,19 @@ def setFilter(self, typeName, aFilter):
def allRastersFilter(self):
if self.rastersFilter.isEmpty():
QgsRasterLayer.buildSupportedRasterFileFilter(self.rastersFilter)
# separates multiple extensions (these are joined by a slash)
self.rastersFilter.replace( QRegExp('([^/])/([^/])'), '\\1 *.\\2')

# workaround for QGis < 1.5 (see #2376)
# separates multiple extensions that joined by a slash
if QGis.QGIS_VERSION[0:3] < "1.8":
formats = self.rastersFilter.split( ";;" )
self.rastersFilter = QString()
for f in formats:
oldExts = QString(f).remove( QRegExp('^.*\(') ).remove( QRegExp('\).*$') )
newExts = QString(oldExts).replace( '/', ' *.' )
if not self.rastersFilter.isEmpty():
self.rastersFilter += ';;'
self.rastersFilter += f.replace( oldExts, newExts )

return self.rastersFilter

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/GdalTools/tools/doTranslate.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def getArguments(self):
test = int(x)
except ValueError:
#print "Coordinates must be integer numbers."
QMessageBox.critical(self, "Translate - srcwin", "Image coordinates (pixels) must be integer numbers.")
QMessageBox.critical(self, self.tr("Translate - srcwin"), self.tr("Image coordinates (pixels) must be integer numbers."))
else:
arguments << "-srcwin"
for x in coordList:
Expand All @@ -207,7 +207,7 @@ def getArguments(self):
test = float(x)
except ValueError:
#print "Coordinates must be integer numbers."
QMessageBox.critical(self, "Translate - prjwin", "Image coordinates (geographic) must be numbers.")
QMessageBox.critical(self, self.tr("Translate - prjwin"), self.tr("Image coordinates (geographic) must be numbers."))
else:
arguments << "-projwin"
for x in coordList:
Expand Down
45 changes: 24 additions & 21 deletions python/plugins/GdalTools/tools/widgetTranslate.ui
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="outsizeSpin">
<property name="maximumSize">
<size>
<width>75</width>
<height>16777215</height>
</size>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Percentage to resize image. This will change pixel size/image resolution accordingly: 25% will create an image with pixels 4x larger.</string>
Expand All @@ -190,22 +190,6 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="nodataSpin">
<property name="maximumSize">
<size>
<width>75</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Assign a specified nodata value to output bands.</string>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="expandCheck">
<property name="toolTip">
Expand Down Expand Up @@ -286,6 +270,25 @@ The 'gray' value (from GDAL 1.7.0) enables to expand a dataset with a color tabl
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="nodataSpin">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Assign a specified nodata value to output bands.</string>
</property>
<property name="minimum">
<number>-999999999</number>
</property>
<property name="maximum">
<number>999999999</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down

0 comments on commit 62d1637

Please sign in to comment.