1
+ import os
2
+ from sextante .parameters .ParameterFile import ParameterFile
3
+ from sextante .fusion .FusionUtils import FusionUtils
4
+ import subprocess
5
+ from sextante .outputs .OutputFile import OutputFile
6
+ from sextante .fusion .FusionAlgorithm import FusionAlgorithm
7
+ from sextante .parameters .ParameterNumber import ParameterNumber
8
+
9
+ class GroundFilter (FusionAlgorithm ):
10
+
11
+ INPUT = "INPUT"
12
+ OUTPUT = "OUTPUT"
13
+ CELLSIZE = "CELLSIZE"
14
+
15
+
16
+ def defineCharacteristics (self ):
17
+ self .name = "Ground Filter"
18
+ self .group = "Points"
19
+ self .addParameter (ParameterFile (self .INPUT , "Input las layer" ))
20
+ self .addParameter (ParameterNumber (self .CELLSIZE , "Cellsize for intermediate surfaces" , 0 , None , 10 ))
21
+ self .addOutput (OutputFile (self .OUTPUT , "Output ground las file" ))
22
+ self .addAdvancedModifiers ()
23
+
24
+ def processAlgorithm (self , progress ):
25
+ commands = [os .path .join (FusionUtils .FusionPath (), "GroundFilter.exe" )]
26
+ commands .append ("/verbose" )
27
+ self .addAdvancedModifiersToCommand (commands )
28
+ outFile = self .getOutputValue (self .OUTPUT ) + ".lda"
29
+ commands .append (str (self .getParameterValue (self .CELLSIZE )))
30
+ commands .append (outFile )
31
+ files = self .getParameterValue (self .INPUT ).split (";" )
32
+ if len (files ) == 1 :
33
+ commands .append (self .getParameterValue (self .INPUT ))
34
+ else :
35
+ FusionUtils .createFileList (files )
36
+ commands .append (FusionUtils .tempFileListFilepath ())
37
+ FusionUtils .runFusion (commands , progress )
38
+ commands = [os .path .join (FusionUtils .FusionPath (), "LDA2LAS.exe" )]
39
+ commands .append (outFile )
40
+ commands .append (self .getOutputValue (self .OUTPUT ))
41
+ p = subprocess .Popen (commands , shell = True )
42
+ p .wait ()
0 commit comments