Skip to content
Permalink
Browse files

Merge pull request #2466 from spono/patch-10

[processing] Update GroundFilter.py
  • Loading branch information
volaya committed Dec 3, 2015
2 parents 3d5f33a + dd8826f commit bbde581457848066d30956a8a5a57db4261e2a58
Showing with 9 additions and 8 deletions.
  1. +9 −8 python/plugins/processing/algs/lidar/fusion/GroundFilter.py
@@ -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
@@ -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')
@@ -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.
You can’t perform that action at this time.