26
26
__revision__ = '$Format:%H$'
27
27
28
28
import os
29
- import subprocess
29
+ from processing . core . parameters import ParameterBoolean
30
30
from processing .core .parameters import ParameterFile
31
31
from processing .core .parameters import ParameterNumber
32
32
from processing .core .outputs import OutputFile
@@ -39,6 +39,7 @@ class GroundFilter(FusionAlgorithm):
39
39
INPUT = 'INPUT'
40
40
OUTPUT = 'OUTPUT'
41
41
CELLSIZE = 'CELLSIZE'
42
+ SURFACE = 'SURFACE'
42
43
43
44
def defineCharacteristics (self ):
44
45
self .name , self .i18n_name = self .trAlgorithm ('Ground Filter' )
@@ -49,24 +50,24 @@ def defineCharacteristics(self):
49
50
self .tr ('Cellsize for intermediate surfaces' ), 0 , None , 10 ))
50
51
self .addOutput (OutputFile (
51
52
self .OUTPUT , self .tr ('Output ground LAS file' )))
53
+ self .addParameter (ParameterBoolean (
54
+ self .SURFACE , self .tr ('Create .dtm surface' ), False ))
52
55
self .addAdvancedModifiers ()
53
56
54
57
def processAlgorithm (self , progress ):
55
58
commands = [os .path .join (FusionUtils .FusionPath (), 'GroundFilter.exe' )]
56
59
commands .append ('/verbose' )
57
60
self .addAdvancedModifiersToCommand (commands )
58
- outFile = self .getOutputValue (self .OUTPUT ) + '.lda'
59
- commands .append (unicode (self .getParameterValue (self .CELLSIZE )))
61
+ surface = self .getParameterValue (self .SURFACE )
62
+ if surface :
63
+ commands .append ('/surface' )
64
+ outFile = self .getOutputValue (self .OUTPUT )
60
65
commands .append (outFile )
66
+ commands .append (unicode (self .getParameterValue (self .CELLSIZE )))
61
67
files = self .getParameterValue (self .INPUT ).split (';' )
62
68
if len (files ) == 1 :
63
69
commands .append (self .getParameterValue (self .INPUT ))
64
70
else :
65
71
FusionUtils .createFileList (files )
66
72
commands .append (FusionUtils .tempFileListFilepath ())
67
73
FusionUtils .runFusion (commands , progress )
68
- commands = [os .path .join (FusionUtils .FusionPath (), 'LDA2LAS.exe' )]
69
- commands .append (outFile )
70
- commands .append (self .getOutputValue (self .OUTPUT ))
71
- p = subprocess .Popen (commands , shell = True )
72
- p .wait ()
0 commit comments