Skip to content

Commit

Permalink
added algorithm option to gdaldem
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15497 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Mar 15, 2011
1 parent b81d2af commit 97dd304
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
6 changes: 6 additions & 0 deletions python/plugins/GdalTools/tools/doDEM.py
Expand Up @@ -35,6 +35,7 @@ def __init__(self, iface):
(self.outputFileEdit, SIGNAL("textChanged(const QString &)")),
(self.computeEdgesCheck, SIGNAL("stateChanged(int)"), None, "1.8.0"),
(self.bandSpin, SIGNAL("valueChanged(int)"), self.bandCheck),
(self.algorithmCheck, SIGNAL("stateChanged(int)"), None, "1.8.0"),
(self.creationOptionsTable, [SIGNAL("cellValueChanged(int, int)"), SIGNAL("rowRemoved()")], self.creationGroupBox),
(self.modeCombo, SIGNAL("currentIndexChanged(int)")),
([self.hillshadeZFactorSpin, self.hillshadeScaleSpin, self.hillshadeAltitudeSpin, self.hillshadeAzimuthSpin], SIGNAL("valueChanged(double)")),
Expand All @@ -54,6 +55,9 @@ def __init__(self, iface):

def showModeParams(self, index):
self.stackedWidget.setVisible( index < 4 )
self.algorithmCheck.setVisible( index < 3 )
if index >= 3:
self.algorithmCheck.setChecked( False )

def onLayersChanged(self):
self.fillInputLayerCombo()
Expand Down Expand Up @@ -120,6 +124,8 @@ def getArguments(self):
arguments << "-exact_color_entry"
elif self.colorNearestRadio.isChecked():
arguments << "-nearest_color_entry"
if self.algorithmCheck.isChecked():
arguments << "-alg" << "ZevenbergenThorne"
if self.computeEdgesCheck.isChecked():
arguments << "-compute_edges"
if self.bandCheck.isChecked():
Expand Down
17 changes: 12 additions & 5 deletions python/plugins/GdalTools/tools/widgetDEM.ui
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>418</width>
<height>408</height>
<width>485</width>
<height>437</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -104,14 +104,14 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="computeEdgesCheck">
<property name="text">
<string>Compute &amp;edges</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&amp;Mode</string>
Expand All @@ -121,7 +121,7 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QComboBox" name="modeCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
Expand Down Expand Up @@ -169,6 +169,13 @@
</item>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="algorithmCheck">
<property name="text">
<string>Use Zevenbergen&amp;&amp;Thorne formula (instead of the Horn's one)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down

0 comments on commit 97dd304

Please sign in to comment.