Skip to content

Commit

Permalink
Update ClipData.py
Browse files Browse the repository at this point in the history
  • Loading branch information
spono committed Nov 20, 2015
1 parent 2fafaac commit fb568c3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions python/plugins/processing/algs/lidar/fusion/ClipData.py
Expand Up @@ -27,6 +27,7 @@


import os import os
import subprocess import subprocess
from processing.core.parameters import ParameterBoolean
from processing.core.parameters import ParameterFile from processing.core.parameters import ParameterFile
from processing.core.parameters import ParameterExtent from processing.core.parameters import ParameterExtent
from processing.core.parameters import ParameterSelection from processing.core.parameters import ParameterSelection
Expand All @@ -41,6 +42,8 @@ class ClipData(FusionAlgorithm):
OUTPUT = 'OUTPUT' OUTPUT = 'OUTPUT'
EXTENT = 'EXTENT' EXTENT = 'EXTENT'
SHAPE = 'SHAPE' SHAPE = 'SHAPE'
DTM = 'DTM'
HEIGHT = 'HEIGHT'


def defineCharacteristics(self): def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Clip Data') self.name, self.i18n_name = self.trAlgorithm('Clip Data')
Expand All @@ -52,13 +55,27 @@ def defineCharacteristics(self):
self.SHAPE, self.tr('Shape'), ['Rectangle', 'Circle'])) self.SHAPE, self.tr('Shape'), ['Rectangle', 'Circle']))
self.addOutput(OutputFile( self.addOutput(OutputFile(
self.OUTPUT, self.tr('Output clipped LAS file'))) self.OUTPUT, self.tr('Output clipped LAS file')))
dtm = ParameterFile(
self.DTM, self.tr('Ground file for height normalization'))
dtm.isAdvanced = True
self.addParameter(dtm)
height = ParameterBoolean(
self.HEIGHT, self.tr("Convert point elevations into heights above ground (used with 'DTM')"), False)
height.isAdvanced = True
self.addParameter(height)
self.addAdvancedModifiers() self.addAdvancedModifiers()


def processAlgorithm(self, progress): def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), 'ClipData.exe')] commands = [os.path.join(FusionUtils.FusionPath(), 'ClipData.exe')]
commands.append('/verbose') commands.append('/verbose')
self.addAdvancedModifiersToCommand(commands) self.addAdvancedModifiersToCommand(commands)
commands.append('/shape:' + unicode(self.getParameterValue(self.SHAPE))) commands.append('/shape:' + unicode(self.getParameterValue(self.SHAPE)))
dtm = self.getParameterValue(self.DTM)
if dtm:
commands.append('/dtm:'+unicode(dtm))
height = self.getParameterValue(self.HEIGHT)
if height:
commands.append('/height')
files = self.getParameterValue(self.INPUT).split(';') files = self.getParameterValue(self.INPUT).split(';')
if len(files) == 1: if len(files) == 1:
commands.append(self.getParameterValue(self.INPUT)) commands.append(self.getParameterValue(self.INPUT))
Expand Down

0 comments on commit fb568c3

Please sign in to comment.