Skip to content

Commit 04d82c0

Browse files
author
brushtyler
committedMar 14, 2011
allow output size in grid tool to fix #2941
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15471 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

4 files changed

+754
-658
lines changed

4 files changed

+754
-658
lines changed
 

‎python/plugins/GdalTools/tools/doGrid.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ def __init__(self, iface):
2020
self.setupUi(self)
2121
BasePluginWidget.__init__(self, self.iface, "gdal_grid")
2222

23+
# set the default QSpinBoxes and QProgressBar value
24+
self.widthSpin.setValue(3000)
25+
self.heightSpin.setValue(3000)
26+
2327
self.extentSelector.setCanvas(self.canvas)
2428
#self.extentSelector.stop()
2529

@@ -44,7 +48,8 @@ def __init__(self, iface):
4448
(self.datametricsCombo, SIGNAL("currentIndexChanged(int)")),
4549
([self.datametricsRadius1Spin, self.datametricsRadius2Spin, self.datametricsAngleSpin, self.datametricsNoDataSpin], SIGNAL("valueChanged(double)")),
4650
(self.datametricsMinPointsSpin, SIGNAL("valueChanged(int)")),
47-
(self.extentSelector, [SIGNAL("selectionStarted()"), SIGNAL("newExtentDefined()")], self.extentGroup)
51+
(self.extentSelector, [SIGNAL("selectionStarted()"), SIGNAL("newExtentDefined()")], self.extentGroup),
52+
( [self.widthSpin, self.heightSpin], SIGNAL( "valueChanged(int)" ), self.resizeGroupBox )
4853
]
4954
)
5055

@@ -122,6 +127,10 @@ def getArguments(self):
122127
if self.algorithmCheck.isChecked() and self.algorithmCombo.currentIndex() >= 0:
123128
arguments << "-a"
124129
arguments << self.algorithmArguments(self.algorithmCombo.currentIndex())
130+
if self.resizeGroupBox.isChecked():
131+
arguments << "-outsize"
132+
arguments << str( self.widthSpin.value() )
133+
arguments << str( self.heightSpin.value() )
125134
if not self.outputFileEdit.text().isEmpty():
126135
arguments << "-of"
127136
arguments << self.outputFormat

‎python/plugins/GdalTools/tools/widgetGrid.ui

Lines changed: 698 additions & 635 deletions
Large diffs are not rendered by default.

‎python/plugins/GdalTools/tools/widgetRasterize.ui

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>509</width>
10-
<height>214</height>
10+
<height>189</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -123,14 +123,17 @@
123123
<property name="checked">
124124
<bool>false</bool>
125125
</property>
126-
<layout class="QGridLayout" name="gridLayout">
127-
<property name="bottomMargin">
128-
<number>0</number>
129-
</property>
126+
<layout class="QGridLayout" name="gridLayout_7">
130127
<item row="0" column="0">
131-
<widget class="QLabel" name="label_4">
128+
<widget class="QLabel" name="label_11">
129+
<property name="sizePolicy">
130+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
131+
<horstretch>0</horstretch>
132+
<verstretch>0</verstretch>
133+
</sizepolicy>
134+
</property>
132135
<property name="text">
133-
<string>Image width</string>
136+
<string>Width</string>
134137
</property>
135138
</widget>
136139
</item>
@@ -141,14 +144,23 @@
141144
</property>
142145
</widget>
143146
</item>
144-
<item row="1" column="0">
145-
<widget class="QLabel" name="label_5">
147+
<item row="0" column="2">
148+
<widget class="QLabel" name="label_12">
149+
<property name="sizePolicy">
150+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
151+
<horstretch>0</horstretch>
152+
<verstretch>0</verstretch>
153+
</sizepolicy>
154+
</property>
146155
<property name="text">
147-
<string>Image height</string>
156+
<string>Height</string>
157+
</property>
158+
<property name="indent">
159+
<number>40</number>
148160
</property>
149161
</widget>
150162
</item>
151-
<item row="1" column="1">
163+
<item row="0" column="3">
152164
<widget class="QSpinBox" name="heightSpin">
153165
<property name="maximum">
154166
<number>999999</number>

‎python/plugins/GdalTools/tools/widgetWarp.ui

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>415</width>
10-
<height>442</height>
10+
<height>417</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -236,14 +236,17 @@
236236
<property name="checked">
237237
<bool>false</bool>
238238
</property>
239-
<layout class="QGridLayout" name="gridLayout">
240-
<property name="bottomMargin">
241-
<number>0</number>
242-
</property>
239+
<layout class="QGridLayout" name="gridLayout_7">
243240
<item row="0" column="0">
244-
<widget class="QLabel" name="label_4">
241+
<widget class="QLabel" name="label_11">
242+
<property name="sizePolicy">
243+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
244+
<horstretch>0</horstretch>
245+
<verstretch>0</verstretch>
246+
</sizepolicy>
247+
</property>
245248
<property name="text">
246-
<string>Image width</string>
249+
<string>Width</string>
247250
</property>
248251
</widget>
249252
</item>
@@ -254,14 +257,23 @@
254257
</property>
255258
</widget>
256259
</item>
257-
<item row="1" column="0">
258-
<widget class="QLabel" name="label_3">
260+
<item row="0" column="2">
261+
<widget class="QLabel" name="label_12">
262+
<property name="sizePolicy">
263+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
264+
<horstretch>0</horstretch>
265+
<verstretch>0</verstretch>
266+
</sizepolicy>
267+
</property>
259268
<property name="text">
260-
<string>Image height</string>
269+
<string>Height</string>
270+
</property>
271+
<property name="indent">
272+
<number>40</number>
261273
</property>
262274
</widget>
263275
</item>
264-
<item row="1" column="1">
276+
<item row="0" column="3">
265277
<widget class="QSpinBox" name="heightSpin">
266278
<property name="maximum">
267279
<number>999999</number>

0 commit comments

Comments
 (0)
Please sign in to comment.