Skip to content

Commit fe0e48b

Browse files
author
volayaf
committedMay 8, 2012
added GroundFilter (fusion)
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@174 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
1 parent 31b48de commit fe0e48b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
 

‎src/sextante/fusion/GroundFilter.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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

Comments
 (0)
Please sign in to comment.