@@ -50,7 +50,7 @@ class CanopyModel(FusionAlgorithm):
50
50
SMOOTH = 'SMOOTH'
51
51
SLOPE = 'SLOPE'
52
52
CLASS = 'CLASS'
53
- ADVANCED_MODIFIERS = 'ADVANCED_MODIFIERS '
53
+ ASCII = 'ASCII '
54
54
55
55
def defineCharacteristics (self ):
56
56
self .name , self .i18n_name = self .trAlgorithm ('Canopy Model' )
@@ -77,18 +77,17 @@ def defineCharacteristics(self):
77
77
self .SMOOTH , self .tr ('Smooth' ), '' , False , True )
78
78
smooth .isAdvanced = True
79
79
self .addParameter (smooth )
80
- slope = ParameterString (
81
- self .SLOPE , self .tr ('Slope' ), '' , False , True )
82
- slope .isAdvanced = True
83
- self .addParameter (slope )
84
80
class_var = ParameterString (
85
81
self .CLASS , self .tr ('Class' ), '' , False , True )
86
82
class_var .isAdvanced = True
87
83
self .addParameter (class_var )
88
- advance_modifiers = ParameterString (
89
- self .ADVANCED_MODIFIERS , self .tr ('Additional modifiers' ), '' , False , True )
90
- advance_modifiers .isAdvanced = True
91
- self .addParameter (advance_modifiers )
84
+ slope = ParameterBoolean (
85
+ self .SLOPE , self .tr ('Calculate slope' ), False )
86
+ slope .isAdvanced = True
87
+ self .addParameter (slope )
88
+ self .addParameter (ParameterBoolean (
89
+ self .ASCII , self .tr ('Add an ASCII output' ), False ))
90
+ self .addAdvancedModifiers ()
92
91
93
92
def processAlgorithm (self , progress ):
94
93
commands = [os .path .join (FusionUtils .FusionPath (), 'CanopyModel.exe' )]
@@ -103,14 +102,15 @@ def processAlgorithm(self, progress):
103
102
if unicode (smooth ).strip ():
104
103
commands .append ('/smooth:' + unicode (smooth ))
105
104
slope = self .getParameterValue (self .SLOPE )
106
- if unicode ( slope ). strip () :
107
- commands .append ('/slope:' + unicode ( slope ) )
105
+ if slope :
106
+ commands .append ('/slope' )
108
107
class_var = self .getParameterValue (self .CLASS )
109
108
if unicode (class_var ).strip ():
110
109
commands .append ('/class:' + unicode (class_var ))
111
- advance_modifiers = unicode (self .getParameterValue (self .ADVANCED_MODIFIERS )).strip ()
112
- if advance_modifiers :
113
- commands .append (advance_modifiers )
110
+ ascii = self .getParameterValue (self .ASCII )
111
+ if ascii :
112
+ commands .append ('/ascii' )
113
+ self .addAdvancedModifiersToCommand (commands )
114
114
commands .append (self .getOutputValue (self .OUTPUT_DTM ))
115
115
commands .append (unicode (self .getParameterValue (self .CELLSIZE )))
116
116
commands .append (self .UNITS [self .getParameterValue (self .XYUNITS )][0 ])
0 commit comments