Skip to content
Permalink
Browse files

Update ClipData.py

  • Loading branch information
spono committed Nov 20, 2015
1 parent 2fafaac commit fb568c323835ff8b58658554cf74f8c9658ef878
Showing with 17 additions and 0 deletions.
  1. +17 −0 python/plugins/processing/algs/lidar/fusion/ClipData.py
@@ -27,6 +27,7 @@

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Clip Data')
@@ -52,13 +55,27 @@ def defineCharacteristics(self):
self.SHAPE, self.tr('Shape'), ['Rectangle', 'Circle']))
self.addOutput(OutputFile(
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()

def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), 'ClipData.exe')]
commands.append('/verbose')
self.addAdvancedModifiersToCommand(commands)
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(';')
if len(files) == 1:
commands.append(self.getParameterValue(self.INPUT))

0 comments on commit fb568c3

Please sign in to comment.
You can’t perform that action at this time.