Skip to content

Commit bbde581

Browse files
committed
Merge pull request #2466 from spono/patch-10
[processing] Update GroundFilter.py
2 parents 3d5f33a + dd8826f commit bbde581

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

python/plugins/processing/algs/lidar/fusion/GroundFilter.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
__revision__ = '$Format:%H$'
2727

2828
import os
29-
import subprocess
29+
from processing.core.parameters import ParameterBoolean
3030
from processing.core.parameters import ParameterFile
3131
from processing.core.parameters import ParameterNumber
3232
from processing.core.outputs import OutputFile
@@ -39,6 +39,7 @@ class GroundFilter(FusionAlgorithm):
3939
INPUT = 'INPUT'
4040
OUTPUT = 'OUTPUT'
4141
CELLSIZE = 'CELLSIZE'
42+
SURFACE = 'SURFACE'
4243

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

5457
def processAlgorithm(self, progress):
5558
commands = [os.path.join(FusionUtils.FusionPath(), 'GroundFilter.exe')]
5659
commands.append('/verbose')
5760
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)
6065
commands.append(outFile)
66+
commands.append(unicode(self.getParameterValue(self.CELLSIZE)))
6167
files = self.getParameterValue(self.INPUT).split(';')
6268
if len(files) == 1:
6369
commands.append(self.getParameterValue(self.INPUT))
6470
else:
6571
FusionUtils.createFileList(files)
6672
commands.append(FusionUtils.tempFileListFilepath())
6773
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

Comments
 (0)