Skip to content

Commit

Permalink
Merge pull request #2466 from spono/patch-10
Browse files Browse the repository at this point in the history
[processing] Update GroundFilter.py
  • Loading branch information
volaya committed Dec 3, 2015
2 parents 3d5f33a + dd8826f commit bbde581
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions python/plugins/processing/algs/lidar/fusion/GroundFilter.py
Expand Up @@ -26,7 +26,7 @@
__revision__ = '$Format:%H$'

import os
import subprocess
from processing.core.parameters import ParameterBoolean
from processing.core.parameters import ParameterFile
from processing.core.parameters import ParameterNumber
from processing.core.outputs import OutputFile
Expand All @@ -39,6 +39,7 @@ class GroundFilter(FusionAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
CELLSIZE = 'CELLSIZE'
SURFACE = 'SURFACE'

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Ground Filter')
Expand All @@ -49,24 +50,24 @@ def defineCharacteristics(self):
self.tr('Cellsize for intermediate surfaces'), 0, None, 10))
self.addOutput(OutputFile(
self.OUTPUT, self.tr('Output ground LAS file')))
self.addParameter(ParameterBoolean(
self.SURFACE, self.tr('Create .dtm surface'), False))
self.addAdvancedModifiers()

def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), 'GroundFilter.exe')]
commands.append('/verbose')
self.addAdvancedModifiersToCommand(commands)
outFile = self.getOutputValue(self.OUTPUT) + '.lda'
commands.append(unicode(self.getParameterValue(self.CELLSIZE)))
surface = self.getParameterValue(self.SURFACE)
if surface:
commands.append('/surface')
outFile = self.getOutputValue(self.OUTPUT)
commands.append(outFile)
commands.append(unicode(self.getParameterValue(self.CELLSIZE)))
files = self.getParameterValue(self.INPUT).split(';')
if len(files) == 1:
commands.append(self.getParameterValue(self.INPUT))
else:
FusionUtils.createFileList(files)
commands.append(FusionUtils.tempFileListFilepath())
FusionUtils.runFusion(commands, progress)
commands = [os.path.join(FusionUtils.FusionPath(), 'LDA2LAS.exe')]
commands.append(outFile)
commands.append(self.getOutputValue(self.OUTPUT))
p = subprocess.Popen(commands, shell=True)
p.wait()

0 comments on commit bbde581

Please sign in to comment.