Skip to content
Permalink
Browse files

[processing] update of lidar algorithms

Provided by Martin Isenburg
  • Loading branch information
volaya committed Dec 22, 2014
1 parent 9e879ed commit 6c7d61f3be719cbac762159bed6e794a9daa8991
Showing with 2,359 additions and 196 deletions.
  1. +36 −6 python/plugins/processing/algs/lidar/LidarToolsAlgorithmProvider.py
  2. +41 −7 python/plugins/processing/algs/lidar/lastools/LAStoolsAlgorithm.py
  3. +20 −6 python/plugins/processing/algs/lidar/lastools/LAStoolsUtils.py
  4. +8 −2 python/plugins/processing/algs/lidar/lastools/blast2dem.py
  5. +81 −0 python/plugins/processing/algs/lidar/lastools/blast2demPro.py
  6. +3 −1 python/plugins/processing/algs/lidar/lastools/blast2iso.py
  7. +88 −0 python/plugins/processing/algs/lidar/lastools/blast2isoPro.py
  8. +5 −5 python/plugins/processing/algs/lidar/lastools/flightlinesToCHM.py
  9. +4 −4 python/plugins/processing/algs/lidar/lastools/flightlinesToDTMandDSM.py
  10. +11 −11 python/plugins/processing/algs/lidar/lastools/flightlinesToSingleCHMpitFree.py
  11. +5 −5 python/plugins/processing/algs/lidar/lastools/hugeFileClassify.py
  12. +3 −3 python/plugins/processing/algs/lidar/lastools/hugeFileGroundClassify.py
  13. +4 −4 python/plugins/processing/algs/lidar/lastools/hugeFileNormalize.py
  14. +8 −2 python/plugins/processing/algs/lidar/lastools/las2dem.py
  15. +7 −3 python/plugins/processing/algs/lidar/lastools/las2demPro.py
  16. +3 −1 python/plugins/processing/algs/lidar/lastools/las2iso.py
  17. +14 −31 python/plugins/processing/algs/lidar/lastools/{las2las.py → las2lasPro_filter.py}
  18. +111 −0 python/plugins/processing/algs/lidar/lastools/las2lasPro_project.py
  19. +75 −0 python/plugins/processing/algs/lidar/lastools/las2lasPro_transform.py
  20. +3 −2 python/plugins/processing/algs/lidar/lastools/las2las_filter.py
  21. +8 −6 python/plugins/processing/algs/lidar/lastools/las2las_project.py
  22. +6 −5 python/plugins/processing/algs/lidar/lastools/las2las_transform.py
  23. +3 −1 python/plugins/processing/algs/lidar/lastools/las2shp.py
  24. +3 −1 python/plugins/processing/algs/lidar/lastools/las2tin.py
  25. +9 −7 python/plugins/processing/algs/lidar/lastools/las2txt.py
  26. +61 −0 python/plugins/processing/algs/lidar/lastools/las2txtPro.py
  27. +21 −9 python/plugins/processing/algs/lidar/lastools/lasboundary.py
  28. +83 −0 python/plugins/processing/algs/lidar/lastools/lasboundaryPro.py
  29. +33 −5 python/plugins/processing/algs/lidar/lastools/lascanopy.py
  30. +147 −0 python/plugins/processing/algs/lidar/lastools/lascanopyPro.py
  31. +3 −1 python/plugins/processing/algs/lidar/lastools/lasclassify.py
  32. +55 −0 python/plugins/processing/algs/lidar/lastools/lasclassifyPro.py
  33. +3 −1 python/plugins/processing/algs/lidar/lastools/lasclip.py
  34. +3 −1 python/plugins/processing/algs/lidar/lastools/lascolor.py
  35. +3 −1 python/plugins/processing/algs/lidar/lastools/lascontrol.py
  36. +3 −1 python/plugins/processing/algs/lidar/lastools/lasduplicate.py
  37. +73 −0 python/plugins/processing/algs/lidar/lastools/lasduplicatePro.py
  38. +8 −1 python/plugins/processing/algs/lidar/lastools/lasgrid.py
  39. +81 −0 python/plugins/processing/algs/lidar/lastools/lasgridPro.py
  40. +9 −5 python/plugins/processing/algs/lidar/lastools/lasground.py
  41. +9 −10 python/plugins/processing/algs/lidar/lastools/lasgroundPro.py
  42. +23 −8 python/plugins/processing/algs/lidar/lastools/lasheight.py
  43. +75 −0 python/plugins/processing/algs/lidar/lastools/lasheightPro.py
  44. +7 −2 python/plugins/processing/algs/lidar/lastools/lasindex.py
  45. +61 −0 python/plugins/processing/algs/lidar/lastools/lasindexPro.py
  46. +47 −1 python/plugins/processing/algs/lidar/lastools/lasinfo.py
  47. +99 −0 python/plugins/processing/algs/lidar/lastools/lasinfoPro.py
  48. +6 −3 python/plugins/processing/algs/lidar/lastools/lasmerge.py
  49. +51 −0 python/plugins/processing/algs/lidar/lastools/lasmergePro.py
  50. +3 −1 python/plugins/processing/algs/lidar/lastools/lasnoise.py
  51. +85 −0 python/plugins/processing/algs/lidar/lastools/lasnoisePro.py
  52. +3 −1 python/plugins/processing/algs/lidar/lastools/lasoverage.py
  53. +75 −0 python/plugins/processing/algs/lidar/lastools/lasoveragePro.py
  54. +3 −1 python/plugins/processing/algs/lidar/lastools/lasoverlap.py
  55. +91 −0 python/plugins/processing/algs/lidar/lastools/lasoverlapPro.py
  56. +3 −1 python/plugins/processing/algs/lidar/lastools/lasprecision.py
  57. +3 −1 python/plugins/processing/algs/lidar/lastools/lasquery.py
  58. +3 −1 python/plugins/processing/algs/lidar/lastools/lassort.py
  59. +64 −0 python/plugins/processing/algs/lidar/lastools/lassortPro.py
  60. +3 −1 python/plugins/processing/algs/lidar/lastools/lassplit.py
  61. +11 −3 python/plugins/processing/algs/lidar/lastools/lasthin.py
  62. +81 −0 python/plugins/processing/algs/lidar/lastools/lasthinPro.py
  63. +6 −2 python/plugins/processing/algs/lidar/lastools/lastile.py
  64. +3 −1 python/plugins/processing/algs/lidar/lastools/lastilePro.py
  65. +12 −5 python/plugins/processing/algs/lidar/lastools/lasvalidate.py
  66. +56 −0 python/plugins/processing/algs/lidar/lastools/lasvalidatePro.py
  67. +26 −4 python/plugins/processing/algs/lidar/lastools/lasview.py
  68. +70 −0 python/plugins/processing/algs/lidar/lastools/lasviewPro.py
  69. +11 −1 python/plugins/processing/algs/lidar/lastools/laszip.py
  70. +69 −0 python/plugins/processing/algs/lidar/lastools/laszipPro.py
  71. +3 −1 python/plugins/processing/algs/lidar/lastools/shp2las.py
  72. +43 −10 python/plugins/processing/algs/lidar/lastools/txt2las.py
  73. +109 −0 python/plugins/processing/algs/lidar/lastools/txt2lasPro.py
@@ -8,7 +8,7 @@
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : April 2014
Date : April, October 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
---------------------
@@ -81,6 +81,30 @@
from lastools.lastilePro import lastilePro
from lastools.lasgroundPro import lasgroundPro
from lastools.las2demPro import las2demPro
from lastools.lasheightPro import lasheightPro
from lastools.laszipPro import laszipPro
from lastools.lasgridPro import lasgridPro
from lastools.lasduplicatePro import lasduplicatePro
from lastools.lassortPro import lassortPro
from lastools.lasclassifyPro import lasclassifyPro
from lastools.lasthinPro import lasthinPro
from lastools.lasnoisePro import lasnoisePro
from lastools.lasindexPro import lasindexPro
from lastools.lascanopyPro import lascanopyPro
from lastools.blast2demPro import blast2demPro
from lastools.lasboundaryPro import lasboundaryPro
from lastools.lasinfoPro import lasinfoPro
from lastools.las2lasPro_filter import las2lasPro_filter
from lastools.las2lasPro_project import las2lasPro_project
from lastools.las2lasPro_transform import las2lasPro_transform
from lastools.lasoveragePro import lasoveragePro
from lastools.txt2lasPro import txt2lasPro
from lastools.las2txtPro import las2txtPro
from lastools.blast2isoPro import blast2isoPro
from lastools.lasvalidatePro import lasvalidatePro
from lastools.lasmergePro import lasmergePro
from lastools.lasviewPro import lasviewPro
from lastools.lasoverlapPro import lasoverlapPro

from lastools.flightlinesToDTMandDSM import flightlinesToDTMandDSM
from lastools.flightlinesToCHM import flightlinesToCHM
@@ -105,7 +129,6 @@
from fusion.FilterData import FilterData
from fusion.FusionUtils import FusionUtils


class LidarToolsAlgorithmProvider(AlgorithmProvider):

def __init__(self):
@@ -115,7 +138,7 @@ def __init__(self):

# LAStools for processing single files

if isWindows():
if (isWindows() or LAStoolsUtils.hasWine()):
lastools = [
lasground(), lasheight(), lasclassify(), lasclip(), lastile(),
lascolor(), lasgrid(), las2dem(), blast2dem(), las2iso(), blast2iso(),
@@ -138,20 +161,27 @@ def __init__(self):

# LAStools Production for processing folders of files

if isWindows():
if (isWindows() or LAStoolsUtils.hasWine()):
lastoolsPro = [
lastilePro(), lasgroundPro(), las2demPro()
lastilePro(), lasgroundPro(), las2demPro(), lasheightPro(), laszipPro(),
lasduplicatePro(), lasgridPro(), lassortPro(), lasclassifyPro(), lasthinPro(),
lasnoisePro(), lasindexPro(), lascanopyPro(), blast2demPro(), lasboundaryPro(),
lasinfoPro(), las2lasPro_filter(), las2lasPro_project(), las2lasPro_transform(),
lasoveragePro(), txt2lasPro(), las2txtPro(), blast2isoPro(), lasvalidatePro(),
lasmergePro(), lasviewPro(), lasoverlapPro()
]
else:
lastoolsPro = [
laszipPro(), lasindexPro(), lasinfoPro(), las2lasPro_filter(), las2lasPro_project(),
las2lasPro_transform(), txt2lasPro(), las2txtPro(), lasvalidatePro(), lasmergePro()
]
for alg in lastoolsPro:
alg.group = 'LAStools Production'
self.algsList.extend(lastoolsPro)

# some examples for LAStools Pipelines

if isWindows():
if (isWindows() or LAStoolsUtils.hasWine()):
lastoolsPipe = [
flightlinesToDTMandDSM(), flightlinesToCHM(), flightlinesToSingleCHMpitFree(), hugeFileClassify(),
hugeFileGroundClassify(), hugeFileNormalize()
@@ -45,10 +45,12 @@
class LAStoolsAlgorithm(GeoAlgorithm):

VERBOSE = "VERBOSE"
GUI = "GUI"
CORES = "CORES"
INPUT_LASLAZ = "INPUT_LASLAZ"
INPUT_DIRECTORY = "INPUT_DIRECTORY"
INPUT_WILDCARDS = "INPUT_WILDCARDS"
MERGED = "MERGED"
OUTPUT_LASLAZ = "OUTPUT_LASLAZ"
OUTPUT_DIRECTORY = "OUTPUT_DIRECTORY"
OUTPUT_APPENDIX = "OUTPUT_APPENDIX"
@@ -65,21 +67,22 @@ class LAStoolsAlgorithm(GeoAlgorithm):
HORIZONTAL_FEET = "HORIZONTAL_FEET"
VERTICAL_FEET = "VERTICAL_FEET"
FILES_ARE_FLIGHTLINES = "FILES_ARE_FLIGHTLINES"
APPLY_FILE_SOURCE_ID = "APPLY_FILE_SOURCE_ID"
STEP = "STEP"
FILTER_RETURN_CLASS_FLAGS1 = "FILTER_RETURN_CLASS_FLAGS1"
FILTER_RETURN_CLASS_FLAGS2 = "FILTER_RETURN_CLASS_FLAGS2"
FILTER_RETURN_CLASS_FLAGS3 = "FILTER_RETURN_CLASS_FLAGS3"
FILTERS_RETURN_CLASS_FLAGS = ["---", "keep_last", "keep_first", "keep_middle", "keep_single", "drop_single",
"keep_double", "keep_class 2", "keep_class 2 8", "keep_class 8", "keep_class 6",
"keep_class 9", "keep_class 3 4 5", "keep_class 2 6", "drop_class 7", "drop_withheld"]
"keep_class 9", "keep_class 3 4 5", "keep_class 2 6", "drop_class 7", "drop_withheld", "drop_synthetic"]
FILTER_COORDS_INTENSITY1 = "FILTER_COORDS_INTENSITY1"
FILTER_COORDS_INTENSITY2 = "FILTER_COORDS_INTENSITY2"
FILTER_COORDS_INTENSITY3 = "FILTER_COORDS_INTENSITY3"
FILTER_COORDS_INTENSITY1_ARG = "FILTER_COORDS_INTENSITY1_ARG"
FILTER_COORDS_INTENSITY2_ARG = "FILTER_COORDS_INTENSITY2_ARG"
FILTER_COORDS_INTENSITY3_ARG = "FILTER_COORDS_INTENSITY3_ARG"
FILTERS_COORDS_INTENSITY = ["---", "clip_x_above", "clip_x_below", "clip_y_above", "clip_y_below", "clip_z_above",
"clip_z_below", "drop_intensity_above", "drop_intensity_below", "drop_gps_time_above",
FILTERS_COORDS_INTENSITY = ["---", "drop_x_above", "drop_x_below", "drop_y_above", "drop_y_below", "drop_z_above",
"drop_z_below", "drop_intensity_above", "drop_intensity_below", "drop_gps_time_above",
"drop_gps_time_below", "drop_scan_angle_above", "drop_scan_angle_below", "keep_point_source",
"drop_point_source", "drop_point_source_above", "drop_point_source_below", "keep_user_data",
"drop_user_data", "drop_user_data_above", "drop_user_data_below", "keep_every_nth",
@@ -110,10 +113,13 @@ def checkBeforeOpeningParametersDialog(self):

def addParametersVerboseGUI(self):
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.VERBOSE, "verbose", False))
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.GUI, "open LAStools GUI", False))

def addParametersVerboseCommands(self, commands):
if self.getParameterValue(LAStoolsAlgorithm.VERBOSE):
commands.append("-v")
if self.getParameterValue(LAStoolsAlgorithm.GUI):
commands.append("-gui")

def addParametersCoresGUI(self):
self.addParameter(ParameterNumber(LAStoolsAlgorithm.CORES, "number of cores", 1, 32, 4))
@@ -125,7 +131,7 @@ def addParametersCoresCommands(self, commands):
commands.append(str(cores))

def addParametersPointInputGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_LASLAZ, "input LAS/LAZ file"))
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_LASLAZ, "input LAS/LAZ file", False, False))

def addParametersPointInputCommands(self, commands):
input = self.getParameterValue(LAStoolsAlgorithm.INPUT_LASLAZ)
@@ -134,7 +140,7 @@ def addParametersPointInputCommands(self, commands):
commands.append(input)

def addParametersPointInputFolderGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, "input directory", True))
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, "input directory", True, False))
self.addParameter(ParameterString(LAStoolsAlgorithm.INPUT_WILDCARDS, "input wildcard(s)", "*.laz"))

def addParametersPointInputFolderCommands(self, commands):
@@ -147,6 +153,27 @@ def addParametersPointInputFolderCommands(self, commands):
else:
commands.append('"' + wildcard + '"')

def addParametersPointInputMergedGUI(self):
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.MERGED, "merge all input files on-the-fly into one", False))

def addParametersPointInputMergedCommands(self, commands):
if self.getParameterValue(LAStoolsAlgorithm.MERGED):
commands.append("-merged")

def addParametersGenericInputFolderGUI(self, wildcard):
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, "input directory", True, False))
self.addParameter(ParameterString(LAStoolsAlgorithm.INPUT_WILDCARDS, "input wildcard(s)", wildcard))

def addParametersGenericInputFolderCommands(self, commands):
input = self.getParameterValue(LAStoolsAlgorithm.INPUT_DIRECTORY)
wildcards = self.getParameterValue(LAStoolsAlgorithm.INPUT_WILDCARDS).split()
for wildcard in wildcards:
commands.append("-i")
if input != None:
commands.append('"' + input + "\\" + wildcard + '"')
else:
commands.append('"' + wildcard + '"')

def addParametersHorizontalFeetGUI(self):
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.HORIZONTAL_FEET, "horizontal feet", False))

@@ -170,12 +197,19 @@ def addParametersHorizontalAndVerticalFeetCommands(self, commands):
self.addParametersVerticalFeetCommands(commands)

def addParametersFilesAreFlightlinesGUI(self):
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES, "files are flightlines", True))
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES, "files are flightlines", False))

def addParametersFilesAreFlightlinesCommands(self, commands):
if self.getParameterValue(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES):
commands.append("-files_are_flightlines")

def addParametersApplyFileSourceIdGUI(self):
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.APPLY_FILE_SOURCE_ID, "apply file source ID", False))

def addParametersApplyFileSourceIdCommands(self, commands):
if self.getParameterValue(LAStoolsAlgorithm.APPLY_FILE_SOURCE_ID):
commands.append("-apply_file_source_ID")

def addParametersStepGUI(self):
self.addParameter(ParameterNumber(LAStoolsAlgorithm.STEP, "step size / pixel size", 0, None, 1.0))

@@ -252,7 +286,7 @@ def addParametersOutputAppendixCommands(self, commands):
commands.append(odix)

def addParametersTemporaryDirectoryGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.TEMPORARY_DIRECTORY, "empty temporary directory", True))
self.addParameter(ParameterFile(LAStoolsAlgorithm.TEMPORARY_DIRECTORY, "empty temporary directory", True, False))

def addParametersTemporaryDirectoryAsOutputDirectoryCommands(self, commands):
odir = self.getParameterValue(LAStoolsAlgorithm.TEMPORARY_DIRECTORY)
@@ -7,6 +7,10 @@
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : October 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
@@ -33,19 +37,29 @@ class LAStoolsUtils:
WINE_FOLDER = "WINE_FOLDER"

@staticmethod
def LAStoolsPath():
folder = ProcessingConfig.getSetting(LAStoolsUtils.LASTOOLS_FOLDER)
if folder == None:
folder =""
def hasWine():
wine_folder = ProcessingConfig.getSetting(LAStoolsUtils.WINE_FOLDER)
return ((wine_folder != None) and (wine_folder != ""))

@staticmethod
def LAStoolsPath():
lastools_folder = ProcessingConfig.getSetting(LAStoolsUtils.LASTOOLS_FOLDER)
if lastools_folder == None:
lastools_folder = ""
wine_folder = ProcessingConfig.getSetting(LAStoolsUtils.WINE_FOLDER)
if (wine_folder == None) or (wine_folder == ""):
folder = lastools_folder
else:
folder = wine_folder + "/wine " + lastools_folder
return folder


@staticmethod
def runLAStools(commands, progress):
loglines = []
loglines.append("LAStools console output")
commandline = " ".join(commands)
loglines.append("LAStools command line")
loglines.append(commandline)
loglines.append("LAStools console output")
proc = subprocess.Popen(commandline, shell=True, stdout=subprocess.PIPE, stdin=open(os.devnull),
stderr=subprocess.STDOUT, universal_newlines=False).stdout
for line in iter(proc.readline, ""):
@@ -28,14 +28,15 @@
from LAStoolsAlgorithm import LAStoolsAlgorithm

from processing.core.parameters import ParameterSelection
from processing.core.parameters import ParameterBoolean

class blast2dem(LAStoolsAlgorithm):

ATTRIBUTE = "ATTRIBUTE"
PRODUCT = "PRODUCT"
ATTRIBUTES = ["elevation", "slope", "intensity", "rgb"]
PRODUCTS = ["actual values", "hillshade", "gray", "false"]

USE_TILE_BB = "USE_TILE_BB"

def defineCharacteristics(self):
self.name = "blast2dem"
@@ -46,10 +47,12 @@ def defineCharacteristics(self):
self.addParametersStepGUI()
self.addParameter(ParameterSelection(blast2dem.ATTRIBUTE, "Attribute", blast2dem.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(blast2dem.PRODUCT, "Product", blast2dem.PRODUCTS, 0))
self.addParameter(ParameterBoolean(blast2dem.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
self.addParametersRasterOutputGUI()
self.addParametersAdditionalGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2dem.exe")]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2dem")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
@@ -60,6 +63,9 @@ def processAlgorithm(self, progress):
product = self.getParameterValue(blast2dem.PRODUCT)
if product != 0:
commands.append("-" + blast2dem.PRODUCTS[product])
if (self.getParameterValue(blast2dem.USE_TILE_BB)):
commands.append("-use_tile_bb")
self.addParametersRasterOutputCommands(commands)
self.addParametersAdditionalCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)
@@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
blast2demPro.py
---------------------
Date : October 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Martin Isenburg'
__date__ = 'October 2014'
__copyright__ = '(C) 2014, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

import os
from LAStoolsUtils import LAStoolsUtils
from LAStoolsAlgorithm import LAStoolsAlgorithm

from processing.core.parameters import ParameterSelection
from processing.core.parameters import ParameterBoolean

class blast2demPro(LAStoolsAlgorithm):

ATTRIBUTE = "ATTRIBUTE"
PRODUCT = "PRODUCT"
ATTRIBUTES = ["elevation", "slope", "intensity", "rgb"]
PRODUCTS = ["actual values", "hillshade", "gray", "false"]
USE_TILE_BB = "USE_TILE_BB"

def defineCharacteristics(self):
self.name = "blast2demPro"
self.group = "LAStools Production"
self.addParametersPointInputFolderGUI()
self.addParametersPointInputMergedGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
self.addParametersStepGUI()
self.addParameter(ParameterSelection(blast2demPro.ATTRIBUTE, "Attribute", blast2demPro.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(blast2demPro.PRODUCT, "Product", blast2demPro.PRODUCTS, 0))
self.addParameter(ParameterBoolean(blast2demPro.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
self.addParametersOutputDirectoryGUI()
self.addParametersOutputAppendixGUI()
self.addParametersRasterOutputFormatGUI()
self.addParametersRasterOutputGUI()
self.addParametersAdditionalGUI()
self.addParametersCoresGUI()
self.addParametersVerboseGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2dem")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
self.addParametersPointInputMergedCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersStepCommands(commands)
attribute = self.getParameterValue(blast2demPro.ATTRIBUTE)
if attribute != 0:
commands.append("-" + blast2demPro.ATTRIBUTES[attribute])
product = self.getParameterValue(blast2demPro.PRODUCT)
if product != 0:
commands.append("-" + blast2demPro.PRODUCTS[product])
if (self.getParameterValue(blast2demPro.USE_TILE_BB)):
commands.append("-use_tile_bb")
self.addParametersOutputDirectoryCommands(commands)
self.addParametersOutputAppendixCommands(commands)
self.addParametersRasterOutputFormatCommands(commands)
self.addParametersRasterOutputCommands(commands)
self.addParametersAdditionalCommands(commands)
self.addParametersCoresCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)

0 comments on commit 6c7d61f

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