Skip to content
Permalink
Browse files

[processing] lidar tools update

changes by Martin Isenburg
  • Loading branch information
volaya authored and alexbruy committed May 30, 2016
1 parent 30813f9 commit d46f98d4e5a9b9e0081204df6d1e85f3e41c76bd
Showing with 1,019 additions and 116 deletions.
  1. +15 −6 python/plugins/processing/algs/lidar/LidarToolsAlgorithmProvider.py
  2. +32 −6 python/plugins/processing/algs/lidar/lastools/LAStoolsAlgorithm.py
  3. +5 −2 python/plugins/processing/algs/lidar/lastools/las2lasPro_filter.py
  4. +5 −2 python/plugins/processing/algs/lidar/lastools/las2lasPro_project.py
  5. +5 −2 python/plugins/processing/algs/lidar/lastools/las2lasPro_transform.py
  6. +5 −2 python/plugins/processing/algs/lidar/lastools/las2las_filter.py
  7. +5 −2 python/plugins/processing/algs/lidar/lastools/las2las_project.py
  8. +5 −2 python/plugins/processing/algs/lidar/lastools/las2las_transform.py
  9. +5 −2 python/plugins/processing/algs/lidar/lastools/las2txt.py
  10. +5 −2 python/plugins/processing/algs/lidar/lastools/las2txtPro.py
  11. +5 −3 python/plugins/processing/algs/lidar/lastools/lasboundary.py
  12. +5 −3 python/plugins/processing/algs/lidar/lastools/lasboundaryPro.py
  13. +5 −1 python/plugins/processing/algs/lidar/lastools/lasclassify.py
  14. +5 −1 python/plugins/processing/algs/lidar/lastools/lasclassifyPro.py
  15. +41 −35 python/plugins/processing/algs/lidar/lastools/lascontrol.py
  16. +74 −0 python/plugins/processing/algs/lidar/lastools/lasdiff.py
  17. +8 −1 python/plugins/processing/algs/lidar/lastools/lasground.py
  18. +101 −0 python/plugins/processing/algs/lidar/lastools/lasgroundPro_new.py
  19. +95 −0 python/plugins/processing/algs/lidar/lastools/lasground_new.py
  20. +7 −3 python/plugins/processing/algs/lidar/lastools/lasheight.py
  21. +8 −3 python/plugins/processing/algs/lidar/lastools/lasheightPro.py
  22. +121 −0 python/plugins/processing/algs/lidar/lastools/lasheightPro_classify.py
  23. +115 −0 python/plugins/processing/algs/lidar/lastools/lasheight_classify.py
  24. +5 −2 python/plugins/processing/algs/lidar/lastools/lasindex.py
  25. +5 −2 python/plugins/processing/algs/lidar/lastools/lasindexPro.py
  26. +5 −2 python/plugins/processing/algs/lidar/lastools/lasinfo.py
  27. +5 −2 python/plugins/processing/algs/lidar/lastools/lasinfoPro.py
  28. +5 −2 python/plugins/processing/algs/lidar/lastools/lasmerge.py
  29. +4 −1 python/plugins/processing/algs/lidar/lastools/lasmergePro.py
  30. +5 −1 python/plugins/processing/algs/lidar/lastools/lasnoise.py
  31. +5 −1 python/plugins/processing/algs/lidar/lastools/lasnoisePro.py
  32. +121 −0 python/plugins/processing/algs/lidar/lastools/laspublish.py
  33. +121 −0 python/plugins/processing/algs/lidar/lastools/laspublishPro.py
  34. +11 −2 python/plugins/processing/algs/lidar/lastools/lasthin.py
  35. +12 −3 python/plugins/processing/algs/lidar/lastools/lasthinPro.py
  36. +11 −9 python/plugins/processing/algs/lidar/lastools/lastile.py
  37. +9 −5 python/plugins/processing/algs/lidar/lastools/lastilePro.py
  38. +4 −1 python/plugins/processing/algs/lidar/lastools/laszip.py
  39. +4 −1 python/plugins/processing/algs/lidar/lastools/laszipPro.py
  40. +5 −2 python/plugins/processing/algs/lidar/lastools/txt2las.py
  41. +5 −2 python/plugins/processing/algs/lidar/lastools/txt2lasPro.py
@@ -8,8 +8,8 @@
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : April, October 2014
Copyright : (C) 2014 by Martin Isenburg
Date : April, October 2014 and May 2016
Copyright : (C) 2014 - 2016 by Martin Isenburg
Email : martin near rapidlasso point com
---------------------
Date : June 2014
@@ -24,7 +24,6 @@
* *
***************************************************************************
"""

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
@@ -76,6 +75,11 @@
from .lastools.lascanopy import lascanopy
from .lastools.lasoverage import lasoverage
from .lastools.lasoverlap import lasoverlap
from .lastools.laspublish import laspublish
from .lastools.lasground_new import lasground_new
from .lastools.lascontrol import lascontrol
from .lastools.lasdiff import lasdiff
from .lastools.lasheight_classify import lasheight_classify

from .lastools.lastilePro import lastilePro
from .lastools.lasgroundPro import lasgroundPro
@@ -104,6 +108,9 @@
from .lastools.lasmergePro import lasmergePro
from .lastools.lasviewPro import lasviewPro
from .lastools.lasoverlapPro import lasoverlapPro
from .lastools.laspublishPro import laspublishPro
from .lastools.lasgroundPro_new import lasgroundPro_new
from .lastools.lasheightPro_classify import lasheightPro_classify

from .lastools.flightlinesToDTMandDSM import flightlinesToDTMandDSM
from .lastools.flightlinesToCHM import flightlinesToCHM
@@ -156,13 +163,14 @@ def _loadAlgorithms(self):
lasindex(), lasthin(), lassort(), lascanopy(), lasmerge(),
las2shp(), shp2las(), lasnoise(), lassplit(), las2las_filter(),
las2las_project(), las2las_transform(), lasoverage(), lasoverlap(),
lasquery()
lasquery(), laspublish(), lasground_new(), lascontrol(), lasdiff(),
lasheight_classify()
]
else:
lastools = [
lasinfo(), lasprecision(), lasvalidate(), las2txt(), txt2las(),
laszip(), lasindex(), lasmerge(), las2las_filter(), las2las_project(),
las2las_transform(), lasquery()
las2las_transform(), lasquery(), lasdiff()
]
self.algs.extend(lastools)

@@ -175,7 +183,8 @@ def _loadAlgorithms(self):
lasnoisePro(), lasindexPro(), lascanopyPro(), blast2demPro(), lasboundaryPro(),
lasinfoPro(), las2lasPro_filter(), las2lasPro_project(), las2lasPro_transform(),
lasoveragePro(), txt2lasPro(), las2txtPro(), blast2isoPro(), lasvalidatePro(),
lasmergePro(), lasviewPro(), lasoverlapPro()
lasmergePro(), lasviewPro(), lasoverlapPro(), laspublishPro(), lasgroundPro_new(),
lasheightPro_classify()
]
else:
lastoolsPro = [
@@ -8,7 +8,7 @@
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : April 2014
Date : April 2014 and May 2016
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -70,12 +70,14 @@ class LAStoolsAlgorithm(GeoAlgorithm):
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", "drop_synthetic"]
"keep_class 9", "keep_class 3 4 5", "keep_class 3", "keep_class 4", "keep_class 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"
@@ -103,6 +105,10 @@ class LAStoolsAlgorithm(GeoAlgorithm):
"scale_scan_angle", "translate_scan_angle", "translate_gps_time", "set_classification", "set_user_data",
"set_point_source", "scale_rgb_up", "scale_rgb_down", "repair_zero_returns"]

IGNORE_CLASS1 = "IGNORE_CLASS1"
IGNORE_CLASS2 = "IGNORE_CLASS2"
IGNORE_CLASSES = ["---", "unclassified (1)", "ground (2)", "veg low (3)", "veg mid (4)", "veg high (5)", "buildings (6)", "noise (7)", "keypoint (8)", "water (9)"]

def getIcon(self):
filepath = os.path.dirname(__file__) + "/../../../images/tool.png"
return QtGui.QIcon(filepath)
@@ -139,7 +145,7 @@ def addParametersPointInputCommands(self, commands):
input = self.getParameterValue(LAStoolsAlgorithm.INPUT_LASLAZ)
if input is not None:
commands.append("-i")
commands.append(input)
commands.append('"' + input + '"')

def addParametersPointInputFolderGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, self.tr("input directory"), True, False))
@@ -232,7 +238,7 @@ def addParametersPointOutputCommands(self, commands):
output = self.getOutputValue(LAStoolsAlgorithm.OUTPUT_LASLAZ)
if output is not None:
commands.append("-o")
commands.append(output)
commands.append('"' + output + '"')

def addParametersPointOutputFormatGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.OUTPUT_POINT_FORMAT, self.tr("output format"), LAStoolsAlgorithm.OUTPUT_POINT_FORMATS, 0))
@@ -279,7 +285,7 @@ def addParametersOutputDirectoryCommands(self, commands):
commands.append(odir)

def addParametersOutputAppendixGUI(self):
self.addParameter(ParameterString(LAStoolsAlgorithm.OUTPUT_APPENDIX, self.tr("output appendix")))
self.addParameter(ParameterString(LAStoolsAlgorithm.OUTPUT_APPENDIX, self.tr("output appendix"), optional=True))

def addParametersOutputAppendixCommands(self, commands):
odix = self.getParameterValue(LAStoolsAlgorithm.OUTPUT_APPENDIX)
@@ -303,7 +309,7 @@ def addParametersTemporaryDirectoryAsInputFilesCommands(self, commands, files):
commands.append(idir + '\\' + files)

def addParametersAdditionalGUI(self):
self.addParameter(ParameterString(LAStoolsAlgorithm.ADDITIONAL_OPTIONS, self.tr("additional command line parameter(s)")), optional=True)
self.addParameter(ParameterString(LAStoolsAlgorithm.ADDITIONAL_OPTIONS, self.tr("additional command line parameter(s)"), optional=True))

def addParametersAdditionalCommands(self, commands):
additional_options = self.getParameterValue(LAStoolsAlgorithm.ADDITIONAL_OPTIONS).split()
@@ -413,3 +419,23 @@ def addParametersTransform2OtherCommands(self, commands):
commands.append("-" + LAStoolsAlgorithm.TRANSFORM_OTHERS[transform2])
if transform2 < 11 and transform2_arg is not None:
commands.append(transform2_arg)

def addParametersIgnoreClass1GUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.IGNORE_CLASS1,
self.tr("ignore points with this classification"), LAStoolsAlgorithm.IGNORE_CLASSES, 0))

def addParametersIgnoreClass1Commands(self, commands):
ignore1 = self.getParameterValue(LAStoolsAlgorithm.IGNORE_CLASS1)
if ignore1 != 0:
commands.append("-ignore_class")
commands.append(unicode(ignore1))

def addParametersIgnoreClass2GUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.IGNORE_CLASS2,
self.tr("also ignore points with this classification"), LAStoolsAlgorithm.IGNORE_CLASSES, 0))

def addParametersIgnoreClass2Commands(self, commands):
ignore2 = self.getParameterValue(LAStoolsAlgorithm.IGNORE_CLASS2)
if ignore2 != 0:
commands.append("-ignore_class")
commands.append(unicode(ignore2))
@@ -4,7 +4,7 @@
***************************************************************************
las2lasPro_filter.py
---------------------
Date : October 2014
Date : October 2014 and May 2016
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -41,7 +41,10 @@ def defineCharacteristics(self):
self.addParametersPointOutputGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
if (LAStoolsUtils.hasWine()):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
else:
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
@@ -4,7 +4,7 @@
***************************************************************************
las2lasPro_project.py
---------------------
Date : October 2014
Date : October 2014 and May 2016
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -70,7 +70,10 @@ def defineCharacteristics(self):
self.addParametersVerboseGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
if (LAStoolsUtils.hasWine()):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
else:
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
source_projection = self.getParameterValue(las2lasPro_project.SOURCE_PROJECTION)
@@ -4,7 +4,7 @@
***************************************************************************
las2lasPro_transform.py
---------------------
Date : October 2014
Date : October 2014 and May 2016
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -58,7 +58,10 @@ def defineCharacteristics(self):
self.addParametersVerboseGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
if (LAStoolsUtils.hasWine()):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
else:
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
self.addParametersTransform1CoordinateCommands(commands)
@@ -4,7 +4,7 @@
***************************************************************************
las2las_filter.py
---------------------
Date : September 2013
Date : September 2013 and May 2016
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -43,7 +43,10 @@ def defineCharacteristics(self):
self.addParametersAdditionalGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
if (LAStoolsUtils.hasWine()):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
else:
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
@@ -4,7 +4,7 @@
***************************************************************************
las2las_project.py
---------------------
Date : September 2013
Date : September 2013 and May 2016
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -67,7 +67,10 @@ def defineCharacteristics(self):
self.addParametersAdditionalGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
if (LAStoolsUtils.hasWine()):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
else:
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
source_projection = self.getParameterValue(las2las_project.SOURCE_PROJECTION)
@@ -4,7 +4,7 @@
***************************************************************************
las2las_transform.py
---------------------
Date : September 2013
Date : September 2013 and May 2016
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -54,7 +54,10 @@ def defineCharacteristics(self):
self.addParametersAdditionalGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
if (LAStoolsUtils.hasWine()):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
else:
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersTransform1CoordinateCommands(commands)
@@ -4,7 +4,7 @@
***************************************************************************
las2txt.py
---------------------
Date : September 2013
Date : September 2013 and May 2016
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -47,7 +47,10 @@ def defineCharacteristics(self):
self.addParametersAdditionalGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt")]
if (LAStoolsUtils.hasWine()):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt.exe")]
else:
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
parse = self.getParameterValue(las2txt.PARSE)
@@ -4,7 +4,7 @@
***************************************************************************
las2txtPro.py
---------------------
Date : October 2014
Date : October 2014 and May 2016
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -47,7 +47,10 @@ def defineCharacteristics(self):
self.addParametersVerboseGUI()

def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt")]
if (LAStoolsUtils.hasWine()):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt.exe")]
else:
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
parse = self.getParameterValue(las2txtPro.PARSE)
@@ -8,7 +8,7 @@
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : September 2013
Date : September 2013 and May 2016
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -39,7 +39,7 @@
class lasboundary(LAStoolsAlgorithm):

MODE = "MODE"
MODES = ["points", "spatial index (the *.lax file)", "bounding box"]
MODES = ["points", "spatial index (the *.lax file)", "bounding box", "tile bounding box"]
CONCAVITY = "CONCAVITY"
DISJOINT = "DISJOINT"
HOLES = "HOLES"
@@ -70,8 +70,10 @@ def processAlgorithm(self, progress):
if (mode != 0):
if (mode == 1):
commands.append("-use_lax")
else:
elif (mode == 2):
commands.append("-use_bb")
else:
commands.append("-use_tile_bb")
else:
concavity = self.getParameterValue(lasboundary.CONCAVITY)
commands.append("-concavity")
@@ -4,7 +4,7 @@
***************************************************************************
lasboundaryPro.py
---------------------
Date : October 2014
Date : October 2014 and May 2016
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
@@ -35,7 +35,7 @@
class lasboundaryPro(LAStoolsAlgorithm):

MODE = "MODE"
MODES = ["points", "spatial index (the *.lax file)", "bounding box"]
MODES = ["points", "spatial index (the *.lax file)", "bounding box", "tile bounding box"]
CONCAVITY = "CONCAVITY"
DISJOINT = "DISJOINT"
HOLES = "HOLES"
@@ -69,8 +69,10 @@ def processAlgorithm(self, progress):
if (mode != 0):
if (mode == 1):
commands.append("-use_lax")
else:
elif (mode == 2):
commands.append("-use_bb")
else:
commands.append("-use_tile_bb")
else:
concavity = self.getParameterValue(lasboundaryPro.CONCAVITY)
commands.append("-concavity")

0 comments on commit d46f98d

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