Skip to content
Permalink
Browse files

Merge pull request #2514 from spono/patch-14

[Processing] Update CanopyModel.py
  • Loading branch information
volaya committed Dec 3, 2015
2 parents 85cc180 + ec9f086 commit 6f26d9aeb09a31e581450121ffe124e74af0ff84
Showing with 14 additions and 14 deletions.
  1. +14 −14 python/plugins/processing/algs/lidar/fusion/CanopyModel.py
@@ -50,7 +50,7 @@ class CanopyModel(FusionAlgorithm):
SMOOTH = 'SMOOTH'
SLOPE = 'SLOPE'
CLASS = 'CLASS'
ADVANCED_MODIFIERS = 'ADVANCED_MODIFIERS'
ASCII = 'ASCII'

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Canopy Model')
@@ -77,18 +77,17 @@ def defineCharacteristics(self):
self.SMOOTH, self.tr('Smooth'), '', False, True)
smooth.isAdvanced = True
self.addParameter(smooth)
slope = ParameterString(
self.SLOPE, self.tr('Slope'), '', False, True)
slope.isAdvanced = True
self.addParameter(slope)
class_var = ParameterString(
self.CLASS, self.tr('Class'), '', False, True)
class_var.isAdvanced = True
self.addParameter(class_var)
advance_modifiers = ParameterString(
self.ADVANCED_MODIFIERS, self.tr('Additional modifiers'), '', False, True)
advance_modifiers.isAdvanced = True
self.addParameter(advance_modifiers)
slope = ParameterBoolean(
self.SLOPE, self.tr('Calculate slope'), False)
slope.isAdvanced = True
self.addParameter(slope)
self.addParameter(ParameterBoolean(
self.ASCII, self.tr('Add an ASCII output'), False))
self.addAdvancedModifiers()

def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), 'CanopyModel.exe')]
@@ -103,14 +102,15 @@ def processAlgorithm(self, progress):
if unicode(smooth).strip():
commands.append('/smooth:' + unicode(smooth))
slope = self.getParameterValue(self.SLOPE)
if unicode(slope).strip():
commands.append('/slope:' + unicode(slope))
if slope:
commands.append('/slope')
class_var = self.getParameterValue(self.CLASS)
if unicode(class_var).strip():
commands.append('/class:' + unicode(class_var))
advance_modifiers = unicode(self.getParameterValue(self.ADVANCED_MODIFIERS)).strip()
if advance_modifiers:
commands.append(advance_modifiers)
ascii = self.getParameterValue(self.ASCII)
if ascii:
commands.append('/ascii')
self.addAdvancedModifiersToCommand(commands)
commands.append(self.getOutputValue(self.OUTPUT_DTM))
commands.append(unicode(self.getParameterValue(self.CELLSIZE)))
commands.append(self.UNITS[self.getParameterValue(self.XYUNITS)][0])

0 comments on commit 6f26d9a

Please sign in to comment.
You can’t perform that action at this time.