[processing] major overhaul of lastools algorithms

Code contributed by Martin Isenburg
This commit is contained in:
Victor Olaya 2014-05-19 19:58:33 +02:00
parent dd47b61bef
commit b1103c0081
53 changed files with 2231 additions and 1030 deletions

View File

@ -8,8 +8,8 @@
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : September 2013
Copyright : (C) 2013 by Martin Isenburg
Date : April 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
* *
@ -43,6 +43,8 @@ from lastools.lasclassify import lasclassify
from lastools.laszip import laszip
from lastools.lasindex import lasindex
from lastools.lasclip import lasclip
from lastools.lasquery import lasquery
from lastools.lascolor import lascolor
from lastools.lasthin import lasthin
from lastools.lasnoise import lasnoise
from lastools.lassort import lassort
@ -54,7 +56,9 @@ from lastools.lasinfo import lasinfo
from lastools.las2dem import las2dem
from lastools.blast2dem import blast2dem
from lastools.las2iso import las2iso
from lastools.las2tin import las2tin
from lastools.las2las_filter import las2las_filter
from lastools.las2las_project import las2las_project
from lastools.las2las_transform import las2las_transform
from lastools.blast2iso import blast2iso
from lastools.lasprecision import lasprecision
@ -69,6 +73,18 @@ from lastools.lassplit import lassplit
from lastools.lascanopy import lascanopy
from lastools.lasoverage import lasoverage
from lastools.lasoverlap import lasoverlap
from lastools.lastilePro import lastilePro
from lastools.lasgroundPro import lasgroundPro
from lastools.las2demPro import las2demPro
from lastools.flightlinesToDTMandDSM import flightlinesToDTMandDSM
from lastools.flightlinesToCHM import flightlinesToCHM
from lastools.flightlinesToSingleCHMpitFree import flightlinesToSingleCHMpitFree
from lastools.hugeFileClassify import hugeFileClassify
from lastools.hugeFileGroundClassify import hugeFileGroundClassify
from lastools.hugeFileNormalize import hugeFileNormalize
from fusion.OpenViewerAction import OpenViewerAction
from fusion.CanopyMaxima import CanopyMaxima
from fusion.CanopyModel import CanopyModel
@ -89,26 +105,58 @@ class LidarToolsAlgorithmProvider(AlgorithmProvider):
AlgorithmProvider.__init__(self)
self.activate = False
self.algsList = []
# LAStools for processing single files
if isWindows():
lastools = [
lasground(), lasheight(), lasclassify(), lasclip(), lastile(),
lasgrid(), las2dem(), blast2dem(), las2iso(), blast2iso(),
lasview(), lasboundary(), lasinfo(), lasprecision(),
lascolor(), lasgrid(), las2dem(), blast2dem(), las2iso(), blast2iso(),
lasview(), lasboundary(), lasinfo(), lasprecision(), las2tin(),
lasvalidate(), lasduplicate(), las2txt(), txt2las(), laszip(),
lasindex(), lasthin(), lassort(), lascanopy(), lasmerge(),
las2shp(), shp2las(), lasnoise(), lassplit(), las2las_filter(),
las2las_transform(), lasoverage(), lasoverlap()
las2las_project(), las2las_transform(), lasoverage(), lasoverlap(),
lasquery()
]
else:
lastools = [
lasinfo(), lasprecision(), lasvalidate(), las2txt(), txt2las(),
laszip(), lasindex(), lasmerge(), las2las_filter(),
las2las_transform()
laszip(), lasindex(), lasmerge(), las2las_filter(), las2las_project(),
las2las_transform(), lasquery()
]
for alg in lastools:
alg.group = 'LAStools'
self.algsList.extend(lastools)
# LAStools Production for processing folders of files
if isWindows():
lastoolsPro = [
lastilePro(), lasgroundPro(), las2demPro()
]
else:
lastoolsPro = [
]
for alg in lastoolsPro:
alg.group = 'LAStools Production'
self.algsList.extend(lastoolsPro)
# some examples for LAStools Pipelines
if isWindows():
lastoolsPipe = [
flightlinesToDTMandDSM(), flightlinesToCHM(), flightlinesToSingleCHMpitFree(), hugeFileClassify(), hugeFileGroundClassify(), hugeFileNormalize()
]
else:
lastoolsPipe = [
]
for alg in lastoolsPipe:
alg.group = 'LAStools Pipelines'
self.algsList.extend(lastoolsPipe)
# FUSION
if isWindows():
self.actions.append(OpenViewerAction())
fusiontools = [
@ -128,6 +176,9 @@ class LidarToolsAlgorithmProvider(AlgorithmProvider):
ProcessingConfig.addSetting(Setting(self.getDescription(),
FusionUtils.FUSION_FOLDER,
'Fusion folder', FusionUtils.FusionPath()))
ProcessingConfig.addSetting(Setting(self.getDescription(),
LAStoolsUtils.WINE_FOLDER,
'Wine folder', ''))
def getName(self):
return 'lidartools'

View File

@ -37,7 +37,7 @@ class FusionAlgorithm(GeoAlgorithm):
ADVANCED_MODIFIERS = 'ADVANCED_MODIFIERS'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/../../images/tool.png'
filepath = os.path.dirname(__file__) + '/../../../images/tool.png'
return QtGui.QIcon(filepath)
def checkBeforeOpeningParametersDialog(self):

View File

@ -39,7 +39,7 @@ class OpenViewerAction(ToolboxAction):
self.group = 'Visualization'
def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + '/../images/tool.png')
return QtGui.QIcon(os.path.dirname(__file__) + '/../../../images/tool.png')
def execute(self):
f = os.path.join(FusionUtils.FusionPath(), 'pdq.exe')

View File

@ -1,3 +1,3 @@
FILE(GLOB PY_FILES *.py)
PLUGIN_INSTALL(processing ./algs/lidar/lastools ${PY_FILES})
PLUGIN_INSTALL(processing ./lidar/lastools ${PY_FILES})

View File

@ -8,8 +8,8 @@
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : August 2013
Copyright : (C) 2013 by Martin Isenburg
Date : April 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
* *
@ -24,15 +24,15 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from processing.core.GeoAlgorithm import GeoAlgorithm
from LAStoolsUtils import LAStoolsUtils
from processing.parameters.ParameterFile import ParameterFile
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
@ -42,110 +42,124 @@ from processing.outputs.OutputFile import OutputFile
from processing.outputs.OutputRaster import OutputRaster
from processing.outputs.OutputVector import OutputVector
class LAStoolsAlgorithm(GeoAlgorithm):
VERBOSE = 'VERBOSE'
INPUT_LASLAZ = 'INPUT_LASLAZ'
OUTPUT_LASLAZ = 'OUTPUT_LASLAZ'
OUTPUT_DIRECTORY = 'OUTPUT_DIRECTORY'
OUTPUT_APPENDIX = 'OUTPUT_APPENDIX'
OUTPUT_POINT_FORMAT = 'OUTPUT_POINT_FORMAT'
OUTPUT_RASTER = 'OUTPUT_RASTER'
OUTPUT_VECTOR = 'OUTPUT_VECTOR'
HORIZONTAL_FEET = 'HORIZONTAL_FEET'
VERTICAL_FEET = 'VERTICAL_FEET'
FILES_ARE_FLIGHTLINES = 'FILES_ARE_FLIGHTLINES'
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']
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', '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',
'keep_random_fraction', 'thin_with_grid'
]
VERBOSE = "VERBOSE"
CORES = "CORES"
INPUT_LASLAZ = "INPUT_LASLAZ"
INPUT_DIRECTORY = "INPUT_DIRECTORY"
INPUT_WILDCARDS = "INPUT_WILDCARDS"
OUTPUT_LASLAZ = "OUTPUT_LASLAZ"
OUTPUT_DIRECTORY = "OUTPUT_DIRECTORY"
OUTPUT_APPENDIX = "OUTPUT_APPENDIX"
OUTPUT_POINT_FORMAT = "OUTPUT_POINT_FORMAT"
OUTPUT_POINT_FORMATS = ["laz", "las"]
OUTPUT_RASTER = "OUTPUT_RASTER"
OUTPUT_RASTER_FORMAT = "OUTPUT_RASTER_FORMAT"
OUTPUT_RASTER_FORMATS = ["tif", "bil", "img", "dtm", "asc", "xyz", "png", "jpg"]
OUTPUT_VECTOR = "OUTPUT_VECTOR"
OUTPUT_VECTOR_FORMAT = "OUTPUT_VECTOR_FORMAT"
OUTPUT_VECTOR_FORMATS = ["shp", "wkt", "kml", "txt"]
ADDITIONAL_OPTIONS = "ADDITIONAL_OPTIONS"
TEMPORARY_DIRECTORY = "TEMPORARY_DIRECTORY"
HORIZONTAL_FEET = "HORIZONTAL_FEET"
VERTICAL_FEET = "VERTICAL_FEET"
FILES_ARE_FLIGHTLINES = "FILES_ARE_FLIGHTLINES"
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"]
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",
"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",
"keep_random_fraction", "thin_with_grid" ]
TRANSFORM_COORDINATE1 = 'TRANSFORM_COORDINATE1'
TRANSFORM_COORDINATE2 = 'TRANSFORM_COORDINATE2'
TRANSFORM_COORDINATE1_ARG = 'TRANSFORM_COORDINATE1_ARG'
TRANSFORM_COORDINATE2_ARG = 'TRANSFORM_COORDINATE2_ARG'
TRANSFORM_COORDINATES = [
'---', 'translate_x', 'translate_y', 'translate_z', 'scale_x',
'scale_y', 'scale_z', 'clamp_z_above', 'clamp_z_below',
]
TRANSFORM_COORDINATE1 = "TRANSFORM_COORDINATE1"
TRANSFORM_COORDINATE2 = "TRANSFORM_COORDINATE2"
TRANSFORM_COORDINATE1_ARG = "TRANSFORM_COORDINATE1_ARG"
TRANSFORM_COORDINATE2_ARG = "TRANSFORM_COORDINATE2_ARG"
TRANSFORM_COORDINATES = ["---", "translate_x", "translate_y", "translate_z", "scale_x", "scale_y", "scale_z", "clamp_z_above", "clamp_z_below"]
TRANSFORM_OTHER1 = 'TRANSFORM_OTHER1'
TRANSFORM_OTHER2 = 'TRANSFORM_OTHER2'
TRANSFORM_OTHER1_ARG = 'TRANSFORM_OTHER1_ARG'
TRANSFORM_OTHER2_ARG = 'TRANSFORM_OTHER2_ARG'
TRANSFORM_OTHERS = [
'---', 'scale_intensity', 'translate_intensity',
'clamp_intensity_above', 'clamp_intensity_below',
'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',
]
TRANSFORM_OTHER1 = "TRANSFORM_OTHER1"
TRANSFORM_OTHER2 = "TRANSFORM_OTHER2"
TRANSFORM_OTHER1_ARG = "TRANSFORM_OTHER1_ARG"
TRANSFORM_OTHER2_ARG = "TRANSFORM_OTHER2_ARG"
TRANSFORM_OTHERS = ["---", "scale_intensity", "translate_intensity", "clamp_intensity_above", "clamp_intensity_below",
"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" ]
def getIcon(self):
filepath = os.path.dirname(__file__) + '/../../images/lastools.png'
filepath = os.path.dirname(__file__) + "/../../../images/tool.png"
return QtGui.QIcon(filepath)
def checkBeforeOpeningParametersDialog(self):
path = LAStoolsUtils.LAStoolsPath()
if path == '':
return 'LAStools folder is not configured.\nPlease configure it \
before running LAStools algorithms.'
if path == "":
return "LAStools folder is not configured.\nPlease configure it before running LAStools algorithms."
def addParametersVerboseGUI(self):
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.VERBOSE, 'verbose'
, True))
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.VERBOSE, "verbose", False))
def addParametersVerboseCommands(self, commands):
if self.getParameterValue(LAStoolsAlgorithm.VERBOSE):
commands.append('-v')
commands.append("-v")
def addParametersCoresGUI(self):
self.addParameter(ParameterNumber(LAStoolsAlgorithm.CORES, "number of cores", 1, 32, 4))
def addParametersCoresCommands(self, commands):
cores = self.getParameterValue(LAStoolsAlgorithm.CORES)
if cores != 1:
commands.append("-cores")
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"))
def addParametersPointInputCommands(self, commands):
input = self.getParameterValue(LAStoolsAlgorithm.INPUT_LASLAZ)
if input is not None:
commands.append('-i')
if input != None:
commands.append("-i")
commands.append(input)
def addParametersPointInputFolderGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, "input directory", True))
self.addParameter(ParameterString(LAStoolsAlgorithm.INPUT_WILDCARDS, "input wildcard(s)", "*.laz"))
def addParametersPointInputFolderCommands(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))
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.HORIZONTAL_FEET, "horizontal feet", False))
def addParametersHorizontalFeetCommands(self, commands):
if self.getParameterValue(LAStoolsAlgorithm.HORIZONTAL_FEET):
commands.append('-feet')
commands.append("-feet")
def addParametersVerticalFeetGUI(self):
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.VERTICAL_FEET,
'vertical feet', False))
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.VERTICAL_FEET, "vertical feet", False))
def addParametersVerticalFeetCommands(self, commands):
if self.getParameterValue(LAStoolsAlgorithm.VERTICAL_FEET):
commands.append('-elevation_feet')
commands.append("-elevation_feet")
def addParametersHorizontalAndVerticalFeetGUI(self):
self.addParametersHorizontalFeetGUI()
@ -154,238 +168,212 @@ class LAStoolsAlgorithm(GeoAlgorithm):
def addParametersHorizontalAndVerticalFeetCommands(self, commands):
self.addParametersHorizontalFeetCommands(commands)
self.addParametersVerticalFeetCommands(commands)
def addParametersFilesAreFlightlinesGUI(self):
self.addParameter(ParameterBoolean(
LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES, 'verbose', True))
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES, "files are flightlines", True))
def addParametersFilesAreFlightlinesCommands(self, commands):
if self.getParameterValue(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES):
commands.append('-files_are_flightlines')
commands.append("-files_are_flightlines")
def addParametersStepGUI(self):
self.addParameter(ParameterNumber(LAStoolsAlgorithm.STEP,
'step size / pixel size', 0, None, 1.0))
self.addParameter(ParameterNumber(LAStoolsAlgorithm.STEP, "step size / pixel size", 0, None, 1.0))
def addParametersStepCommands(self, commands):
step = self.getParameterValue(LAStoolsAlgorithm.STEP)
if step != 0.0:
commands.append('-step')
commands.append(str(step))
commands.append("-step")
commands.append(str(step))
def addParametersPointOutputFileGUI(self):
self.addOutput(OutputFile(LAStoolsAlgorithm.OUTPUT_LASLAZ,
'Output LAS/LAZ file'))
def addParametersPointOutputFileCommands(self, commands):
output = self.getOutputValue(LAStoolsAlgorithm.OUTPUT_LASLAZ)
if output is not None:
commands.append('-o')
commands.append(output)
def addParametersPointOutputDirectoryGUI(self):
self.addOutput(OutputFile(LAStoolsAlgorithm.OUTPUT_DIRECTORY,
'Output directory'))
def addParametersPointOutputDirectoryCommands(self, commands):
odir = self.getParameterValue(LAStoolsAlgorithm.OUTPUT_DIRECTORY)
if odir is not None:
commands.append('-o')
commands.append(odir)
def addParametersPointOutputAppendixGUI(self):
self.addOutput(OutputFile(LAStoolsAlgorithm.OUTPUT_APPENDIX,
'Output appendix'))
def addParametersPointOutputAppendixCommands(self, commands):
odix = self.getParameterValue(LAStoolsAlgorithm.OUTPUT_APPENDIX)
if odix is not None:
commands.append('-odix')
commands.append(odix)
def addParametersPointOutputFormatGUI(self):
self.addOutput(OutputFile(LAStoolsAlgorithm.OUTPUT_POINT_FORMAT,
'Output format'))
def addParametersPointOutputFormatCommands(self, commands):
commands.append('-o')
commands.append(self.getParameterValue(
LAStoolsAlgorithm.OUTPUT_POINT_FORMAT))
def getParametersStepValue(self):
step = self.getParameterValue(LAStoolsAlgorithm.STEP)
return step
def addParametersPointOutputGUI(self):
self.addParametersPointOutputFileGUI()
self.addOutput(OutputFile(LAStoolsAlgorithm.OUTPUT_LASLAZ, "output LAS/LAZ file", "laz"))
def addParametersPointOutputCommands(self, commands):
self.addParametersPointOutputFileCommands(commands)
output = self.getOutputValue(LAStoolsAlgorithm.OUTPUT_LASLAZ)
if output != None:
commands.append("-o")
commands.append(output)
def addParametersPointOutputFormatGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.OUTPUT_POINT_FORMAT, "output format", LAStoolsAlgorithm.OUTPUT_POINT_FORMATS, 0))
def addParametersPointOutputFormatCommands(self, commands):
format = self.getParameterValue(LAStoolsAlgorithm.OUTPUT_POINT_FORMAT)
commands.append("-o" + LAStoolsAlgorithm.OUTPUT_POINT_FORMATS[format])
def addParametersRasterOutputGUI(self):
self.addOutput(OutputRaster(LAStoolsAlgorithm.OUTPUT_RASTER,
'Output raster file'))
self.addOutput(OutputRaster(LAStoolsAlgorithm.OUTPUT_RASTER, "Output raster file"))
def addParametersRasterOutputCommands(self, commands):
commands.append('-o')
commands.append("-o")
commands.append(self.getOutputValue(LAStoolsAlgorithm.OUTPUT_RASTER))
def addParametersRasterOutputFormatGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.OUTPUT_RASTER_FORMAT, "output format", LAStoolsAlgorithm.OUTPUT_RASTER_FORMATS, 0))
def addParametersRasterOutputFormatCommands(self, commands):
format = self.getParameterValue(LAStoolsAlgorithm.OUTPUT_RASTER_FORMAT)
commands.append("-o" + LAStoolsAlgorithm.OUTPUT_RASTER_FORMATS[format])
def addParametersVectorOutputGUI(self):
self.addOutput(OutputVector(LAStoolsAlgorithm.OUTPUT_VECTOR,
'Output vector file'))
self.addOutput(OutputVector(LAStoolsAlgorithm.OUTPUT_VECTOR, "Output vector file"))
def addParametersVectorOutputCommands(self, commands):
commands.append('-o')
commands.append("-o")
commands.append(self.getOutputValue(LAStoolsAlgorithm.OUTPUT_VECTOR))
def addParametersVectorOutputFormatGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.OUTPUT_VECTOR_FORMAT, "output format", LAStoolsAlgorithm.OUTPUT_VECTOR_FORMATS, 0))
def addParametersVectorOutputFormatCommands(self, commands):
format = self.getParameterValue(LAStoolsAlgorithm.OUTPUT_VECTOR_FORMAT)
commands.append("-o" + LAStoolsAlgorithm.OUTPUT_VECTOR_FORMATS[format])
def addParametersOutputDirectoryGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.OUTPUT_DIRECTORY, "output directory", True))
def addParametersOutputDirectoryCommands(self, commands):
odir = self.getParameterValue(LAStoolsAlgorithm.OUTPUT_DIRECTORY)
if odir != "":
commands.append("-odir")
commands.append(odir)
def addParametersOutputAppendixGUI(self):
self.addParameter(ParameterString(LAStoolsAlgorithm.OUTPUT_APPENDIX, "output appendix"))
def addParametersOutputAppendixCommands(self, commands):
odix = self.getParameterValue(LAStoolsAlgorithm.OUTPUT_APPENDIX)
if odix != "":
commands.append("-odix")
commands.append(odix)
def addParametersTemporaryDirectoryGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.TEMPORARY_DIRECTORY, "empty temporary directory", True))
def addParametersTemporaryDirectoryAsOutputDirectoryCommands(self, commands):
odir = self.getParameterValue(LAStoolsAlgorithm.TEMPORARY_DIRECTORY)
if odir != "":
commands.append("-odir")
commands.append(odir)
def addParametersTemporaryDirectoryAsInputFilesCommands(self, commands, files):
idir = self.getParameterValue(LAStoolsAlgorithm.TEMPORARY_DIRECTORY)
if idir != "":
commands.append("-i")
commands.append(idir+'\\'+files)
def addParametersAdditionalGUI(self):
self.addParameter(ParameterString(LAStoolsAlgorithm.ADDITIONAL_OPTIONS, "additional command line parameter(s)"))
def addParametersAdditionalCommands(self, commands):
additional_options = self.getParameterValue(LAStoolsAlgorithm.ADDITIONAL_OPTIONS).split()
for option in additional_options:
commands.append(option)
def addParametersFilter1ReturnClassFlagsGUI(self):
self.addParameter(ParameterSelection(
LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS1,
'filter (by return, classification, flags)',
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS1, "filter (by return, classification, flags)",
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))
def addParametersFilter1ReturnClassFlagsCommands(self, commands):
filter1 = self.getParameterValue(
LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS1)
filter1 = self.getParameterValue(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS1)
if filter1 != 0:
commands.append('-'
+ LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter1])
commands.append("-" + LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter1])
def addParametersFilter2ReturnClassFlagsGUI(self):
self.addParameter(ParameterSelection(
LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS2,
'second filter (by return, classification, flags)',
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS2, "second filter (by return, classification, flags)",
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))
def addParametersFilter2ReturnClassFlagsCommands(self, commands):
filter2 = self.getParameterValue(
LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS2)
filter2 = self.getParameterValue(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS2)
if filter2 != 0:
commands.append('-'
+ LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter2])
commands.append("-" + LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter2])
def addParametersFilter3ReturnClassFlagsGUI(self):
self.addParameter(ParameterSelection(
LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS3,
'third filter (by return, classification, flags)',
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS3, "third filter (by return, classification, flags)",
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))
def addParametersFilter3ReturnClassFlagsCommands(self, commands):
filter3 = self.getParameterValue(
LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS3)
filter3 = self.getParameterValue(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS3)
if filter3 != 0:
commands.append('-'
+ LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter3])
commands.append("-" + LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter3])
def addParametersFilter1CoordsIntensityGUI(self):
self.addParameter(ParameterSelection(
LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1,
'filter (by coordinate, intensity, GPS time, ...)',
LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY, 0))
self.addParameter(ParameterString(
LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1_ARG,
'value for filter (by coordinate, intensity, GPS time, ...)'))
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1, "filter (by coordinate, intensity, GPS time, ...)",
LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1_ARG, "value for filter (by coordinate, intensity, GPS time, ...)"))
def addParametersFilter1CoordsIntensityCommands(self, commands):
filter1 = self.getParameterValue(
LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1)
filter1_arg = self.getParameterValue(
LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1_ARG)
if filter1 != 0 and filter1_arg is not None:
commands.append('-'
+ LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY[filter1])
filter1 = self.getParameterValue(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1)
filter1_arg = self.getParameterValue(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1_ARG)
if filter1 != 0 and filter1_arg != None:
commands.append("-" + LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY[filter1])
commands.append(filter1_arg)
def addParametersFilter2CoordsIntensityGUI(self):
self.addParameter(ParameterSelection(
LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2,
'second filter (by coordinate, intensity, GPS time, ...)',
LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY, 0))
self.addParameter(ParameterString(
LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2_ARG,
'value for second filter (by coordinate, intensity, \
GPS time, ...)'))
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2, "second filter (by coordinate, intensity, GPS time, ...)", LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2_ARG, "value for second filter (by coordinate, intensity, GPS time, ...)"))
def addParametersFilter2CoordsIntensityCommands(self, commands):
filter2 = self.getParameterValue(
LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2)
filter2_arg = self.getParameterValue(
LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2_ARG)
if filter2 != 0 and filter2_arg is not None:
commands.append('-'
+ LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY[filter2])
filter2 = self.getParameterValue(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2)
filter2_arg = self.getParameterValue(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2_ARG)
if filter2 != 0 and filter2_arg != None:
commands.append("-" + LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY[filter2])
commands.append(filter2_arg)
def addParametersTransform1CoordinateGUI(self):
self.addParameter(ParameterSelection(
LAStoolsAlgorithm.TRANSFORM_COORDINATE1,
'transform (coordinates)',
LAStoolsAlgorithm.TRANSFORM_COORDINATES, 0))
self.addParameter(ParameterString(
LAStoolsAlgorithm.TRANSFORM_COORDINATE1_ARG,
'value for transform (coordinates)'))
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE1,
"transform (coordinates)", LAStoolsAlgorithm.TRANSFORM_COORDINATES, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE1_ARG,
"value for transform (coordinates)"))
def addParametersTransform1CoordinateCommands(self, commands):
transform1 = self.getParameterValue(
LAStoolsAlgorithm.TRANSFORM_COORDINATE1)
transform1_arg = self.getParameterValue(
LAStoolsAlgorithm.TRANSFORM_COORDINATE1_ARG)
if transform1 != 0 and transform1_arg is not None:
commands.append('-'
+ LAStoolsAlgorithm.TRANSFORM_COORDINATES[transform1])
transform1 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_COORDINATE1)
transform1_arg = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_COORDINATE1_ARG)
if transform1 != 0 and transform1_arg != None:
commands.append("-" + LAStoolsAlgorithm.TRANSFORM_COORDINATES[transform1])
commands.append(transform1_arg)
def addParametersTransform2CoordinateGUI(self):
self.addParameter(ParameterSelection(
LAStoolsAlgorithm.TRANSFORM_COORDINATE2,
'second transform (coordinates)',
LAStoolsAlgorithm.TRANSFORM_COORDINATES, 0))
self.addParameter(ParameterString(
LAStoolsAlgorithm.TRANSFORM_COORDINATE2_ARG,
'value for second transform (coordinates)'))
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE2,
"second transform (coordinates)", LAStoolsAlgorithm.TRANSFORM_COORDINATES, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE2_ARG,
"value for second transform (coordinates)"))
def addParametersTransform2CoordinateCommands(self, commands):
transform2 = self.getParameterValue(
LAStoolsAlgorithm.TRANSFORM_COORDINATE2)
transform2_arg = self.getParameterValue(
LAStoolsAlgorithm.TRANSFORM_COORDINATE2_ARG)
if transform2 != 0 and transform2_arg is not None:
commands.append('-'
+ LAStoolsAlgorithm.TRANSFORM_COORDINATES[transform2])
transform2 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_COORDINATE2)
transform2_arg = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_COORDINATE2_ARG)
if transform2 != 0 and transform2_arg != None:
commands.append("-" + LAStoolsAlgorithm.TRANSFORM_COORDINATES[transform2])
commands.append(transform2_arg)
def addParametersTransform1OtherGUI(self):
self.addParameter(ParameterSelection(
LAStoolsAlgorithm.TRANSFORM_OTHER1,
'transform (intensities, scan angles, GPS times, ...)',
LAStoolsAlgorithm.TRANSFORM_OTHERS, 0))
self.addParameter(ParameterString(
LAStoolsAlgorithm.TRANSFORM_OTHER1_ARG,
'value for transform (intensities, scan angles, \
GPS times, ...)'))
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER1,
"transform (intensities, scan angles, GPS times, ...)", LAStoolsAlgorithm.TRANSFORM_OTHERS, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER1_ARG,
"value for transform (intensities, scan angles, GPS times, ...)"))
def addParametersTransform1OtherCommands(self, commands):
transform1 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_OTHER1)
transform1_arg = self.getParameterValue(
LAStoolsAlgorithm.TRANSFORM_OTHER1_ARG)
transform1_arg = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_OTHER1_ARG)
if transform1 != 0:
commands.append('-'
+ LAStoolsAlgorithm.TRANSFORM_OTHERS[transform1])
if transform1 < 11 and transform1_arg is not None:
commands.append("-" + LAStoolsAlgorithm.TRANSFORM_OTHERS[transform1])
if transform1 < 11 and transform1_arg != None:
commands.append(transform1_arg)
def addParametersTransform2OtherGUI(self):
self.addParameter(ParameterSelection(
LAStoolsAlgorithm.TRANSFORM_OTHER2,
'second transform (intensities, scan angles, GPS times, ...)',
LAStoolsAlgorithm.TRANSFORM_OTHERS, 0))
self.addParameter(ParameterString(
LAStoolsAlgorithm.TRANSFORM_OTHER2_ARG,
'value for second transform (intensities, scan angles, \
GPS times, ...)'))
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER2,
"second transform (intensities, scan angles, GPS times, ...)", LAStoolsAlgorithm.TRANSFORM_OTHERS, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER2_ARG,
"value for second transform (intensities, scan angles, GPS times, ...)"))
def addParametersTransform2OtherCommands(self, commands):
transform2 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_OTHER2)
transform2_arg = self.getParameterValue(
LAStoolsAlgorithm.TRANSFORM_OTHER2_ARG)
transform2_arg = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_OTHER2_ARG)
if transform2 != 0:
commands.append('-'
+ LAStoolsAlgorithm.TRANSFORM_OTHERS[transform2])
if transform2 < 11 and transform2_arg is not None:
commands.append("-" + LAStoolsAlgorithm.TRANSFORM_OTHERS[transform2])
if transform2 < 11 and transform2_arg != None:
commands.append(transform2_arg)

View File

@ -20,43 +20,34 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import subprocess
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from processing.core.ProcessingLog import ProcessingLog
from processing.core.ProcessingConfig import ProcessingConfig
class LAStoolsUtils:
LASTOOLS_FOLDER = 'LASTOOLS_FOLDER'
LASTOOLS_FOLDER = "LASTOOLS_FOLDER"
WINE_FOLDER = "WINE_FOLDER"
@staticmethod
def LAStoolsPath():
folder = ProcessingConfig.getSetting(LAStoolsUtils.LASTOOLS_FOLDER)
if folder is None:
folder = ''
if folder == None:
folder =""
return folder
@staticmethod
def runLAStools(commands, progress):
loglines = []
loglines.append('LAStools console output')
commandline = ' '.join(commands)
proc = subprocess.Popen(
commandline,
shell=True,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=False,
).stdout
for line in iter(proc.readline, ''):
loglines.append("LAStools console output")
commandline = " ".join(commands)
proc = subprocess.Popen(commandline, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE,
stderr=subprocess.STDOUT, universal_newlines=False).stdout
for line in iter(proc.readline, ""):
loglines.append(line)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)

View File

@ -20,55 +20,46 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from LAStoolsUtils import LAStoolsUtils
from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterSelection import ParameterSelection
class blast2dem(LAStoolsAlgorithm):
ATTRIBUTE = 'ATTRIBUTE'
PRODUCT = 'PRODUCT'
ATTRIBUTES = ['elevation', 'slope', 'intensity', 'rgb']
PRODUCTS = ['actual values', 'hillshade', 'gray', 'false']
ATTRIBUTE = "ATTRIBUTE"
PRODUCT = "PRODUCT"
ATTRIBUTES = ["elevation", "slope", "intensity", "rgb"]
PRODUCTS = ["actual values", "hillshade", "gray", "false"]
def defineCharacteristics(self):
self.name = 'blast2dem'
self.group = 'LAStools'
self.name = "blast2dem"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
self.addParametersStepGUI()
self.addParameter(ParameterSelection(blast2dem.ATTRIBUTE, 'Attribute',
blast2dem.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(blast2dem.PRODUCT, 'Product',
blast2dem.PRODUCTS, 0))
self.addParameter(ParameterSelection(blast2dem.ATTRIBUTE, "Attribute", blast2dem.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(blast2dem.PRODUCT, "Product", blast2dem.PRODUCTS, 0))
self.addParametersRasterOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'blast2dem.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersStepCommands(commands)
attribute = self.getParameterValue(blast2dem.ATTRIBUTE)
if attribute != 0:
commands.append('-' + blast2dem.ATTRIBUTES[attribute])
commands.append("-" + blast2dem.ATTRIBUTES[attribute])
product = self.getParameterValue(blast2dem.PRODUCT)
if product != 0:
commands.append('-' + blast2dem.PRODUCTS[product])
commands.append("-" + blast2dem.PRODUCTS[product])
self.addParametersRasterOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -31,57 +29,47 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterNumber import ParameterNumber
class blast2iso(LAStoolsAlgorithm):
SMOOTH = 'SMOOTH'
ISO_EVERY = 'ISO_EVERY'
SIMPLIFY_LENGTH = 'SIMPLIFY_LENGTH'
SIMPLIFY_AREA = 'SIMPLIFY_AREA'
CLEAN = 'CLEAN'
SMOOTH = "SMOOTH"
ISO_EVERY = "ISO_EVERY"
SIMPLIFY_LENGTH = "SIMPLIFY_LENGTH"
SIMPLIFY_AREA = "SIMPLIFY_AREA"
CLEAN = "CLEAN"
def defineCharacteristics(self):
self.name = 'blast2iso'
self.group = 'LAStools'
self.name = "blast2iso"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterNumber(blast2iso.SMOOTH,
'smooth underlying TIN', 0, None, 0))
self.addParameter(ParameterNumber(blast2iso.ISO_EVERY,
'extract isoline with a spacing of', 0, None, 10.0))
self.addParameter(ParameterNumber(blast2iso.CLEAN,
'clean isolines shorter than (0 = do not clean)',
None, None, 0.0))
self.addParameter(ParameterNumber(blast2iso.SIMPLIFY_LENGTH,
'simplify segments shorter than (0 = do not simplify)',
None, None, 0.0))
self.addParameter(ParameterNumber(blast2iso.SIMPLIFY_AREA,
"simplify segments pairs with area less than (0 = don't simplify)",
None, None, 0.0))
self.addParameter(ParameterNumber(blast2iso.SMOOTH, "smooth underlying TIN", 0, None, 0))
self.addParameter(ParameterNumber(blast2iso.ISO_EVERY, "extract isoline with a spacing of", 0, None, 10.0))
self.addParameter(ParameterNumber(blast2iso.CLEAN, "clean isolines shorter than (0 = do not clean)", None, None, 0.0))
self.addParameter(ParameterNumber(blast2iso.SIMPLIFY_LENGTH, "simplify segments shorter than (0 = do not simplify)", None, None, 0.0))
self.addParameter(ParameterNumber(blast2iso.SIMPLIFY_AREA, "simplify segments pairs with area less than (0 = do not simplify)", None, None, 0.0))
self.addParametersVectorOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'blast2iso.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2iso.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersPointInputCommands(commands)
smooth = self.getParameterValue(blast2iso.SMOOTH)
if smooth != 0:
commands.append('-smooth')
commands.append("-smooth")
commands.append(str(smooth))
commands.append('-iso_every')
commands.append("-iso_every")
commands.append(str(self.getParameterValue(blast2iso.ISO_EVERY)))
simplify_length = self.getParameterValue(blast2iso.SIMPLIFY_LENGTH)
if simplify_length != 0:
commands.append('-simplify_length')
commands.append("-simplify_length")
commands.append(str(simplify_length))
simplify_area = self.getParameterValue(blast2iso.SIMPLIFY_AREA)
if simplify_area != 0:
commands.append('-simplify_area')
commands.append("-simplify_area")
commands.append(str(simplify_area))
clean = self.getParameterValue(blast2iso.CLEAN)
if clean != 0:
commands.append('-clean')
commands.append("-clean")
commands.append(str(clean))
self.addParametersVectorOutputCommands(commands)

View File

@ -0,0 +1,156 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
flightlinesToCHM.py
---------------------
Date : May 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__ = 'May 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.parameters.ParameterSelection import ParameterSelection
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
class flightlinesToCHM(LAStoolsAlgorithm):
TILE_SIZE = "TILE_SIZE"
BUFFER = "BUFFER"
TERRAIN = "TERRAIN"
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
BEAM_WIDTH = "BEAM_WIDTH"
BASE_NAME = "BASE_NAME"
def defineCharacteristics(self):
self.name = "flightlinesToCHM"
self.group = "LAStools Pipelines"
self.addParametersPointInputFolderGUI()
self.addParameter(ParameterNumber(flightlinesToCHM.TILE_SIZE, "tile size (side length of square tile)", 0, None, 1000.0))
self.addParameter(ParameterNumber(flightlinesToCHM.BUFFER, "buffer around each tile (avoids edge artifacts)", 0, None, 25.0))
self.addParameter(ParameterSelection(flightlinesToCHM.TERRAIN, "terrain type", flightlinesToCHM.TERRAINS, 1))
self.addParameter(ParameterNumber(flightlinesToCHM.BEAM_WIDTH, "laser beam width (diameter of laser footprint)", 0, None, 0.2))
self.addParametersStepGUI()
self.addParametersTemporaryDirectoryGUI()
self.addParametersOutputDirectoryGUI()
self.addParameter(ParameterString(flightlinesToCHM.BASE_NAME, "tile base name (using 'sydney' creates sydney_274000_4714000...)","tile"))
self.addParametersRasterOutputFormatGUI()
self.addParametersCoresGUI()
self.addParametersVerboseGUI()
def processAlgorithm(self, progress):
# first we tile the data
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
commands.append("-files_are_flightlines")
tile_size = self.getParameterValue(flightlinesToCHM.TILE_SIZE)
commands.append("-tile_size")
commands.append(str(tile_size))
buffer = self.getParameterValue(flightlinesToCHM.BUFFER)
if buffer != 0.0:
commands.append("-buffer")
commands.append(str(buffer))
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
base_name = self.getParameterValue(flightlinesToCHM.BASE_NAME)
if base_name == "":
base_name = "tile"
commands.append("-o")
commands.append(base_name)
commands.append("-olaz")
LAStoolsUtils.runLAStools(commands, progress)
# then we ground classify the tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*.laz")
method = self.getParameterValue(flightlinesToCHM.TERRAIN)
if method != 1:
commands.append("-" + flightlinesToCHM.TERRAINS[method])
if method > 2:
commands.append("-ultra_fine")
elif method > 1:
commands.append("-extra_fine")
elif method > 0:
commands.append("-fine")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("_g")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we height-normalize the tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_g.laz")
commands.append("-replace_z")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("h")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we thin and splat the tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_gh.laz")
beam_width = self.getParameterValue(flightlinesToCHM.BEAM_WIDTH)
if beam_width != 0.0:
commands.append("-subcircle")
commands.append(str(beam_width/2))
step = self.getParametersStepValue()
commands.append("-step")
commands.append(str(step/4))
commands.append("-highest")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("t")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we rasterize the classified tiles into CHMs
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_ght.laz")
self.addParametersStepCommands(commands)
commands.append("-use_tile_bb")
self.addParametersOutputDirectoryCommands(commands)
commands.append("-ocut")
commands.append("4")
commands.append("-odix")
commands.append("_chm")
self.addParametersRasterOutputFormatCommands(commands)
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,139 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
flightlinesToDTMandDSM.py
---------------------
Date : April 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__ = 'May 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.parameters.ParameterSelection import ParameterSelection
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
class flightlinesToDTMandDSM(LAStoolsAlgorithm):
TILE_SIZE = "TILE_SIZE"
BUFFER = "BUFFER"
TERRAIN = "TERRAIN"
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
BASE_NAME = "BASE_NAME"
def defineCharacteristics(self):
self.name = "flightlinesToDTMandDSM"
self.group = "LAStools Pipelines"
self.addParametersPointInputFolderGUI()
self.addParameter(ParameterNumber(flightlinesToDTMandDSM.TILE_SIZE, "tile size (side length of square tile)", 0, None, 1000.0))
self.addParameter(ParameterNumber(flightlinesToDTMandDSM.BUFFER, "buffer around each tile (avoids edge artifacts)", 0, None, 25.0))
self.addParameter(ParameterSelection(flightlinesToDTMandDSM.TERRAIN, "terrain type", flightlinesToDTMandDSM.TERRAINS, 1))
self.addParametersStepGUI()
self.addParametersTemporaryDirectoryGUI()
self.addParametersOutputDirectoryGUI()
self.addParameter(ParameterString(flightlinesToDTMandDSM.BASE_NAME, "tile base name (using 'sydney' creates sydney_274000_4714000...)","tile"))
self.addParametersRasterOutputFormatGUI()
self.addParametersCoresGUI()
self.addParametersVerboseGUI()
def processAlgorithm(self, progress):
# first we tile the data
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
commands.append("-files_are_flightlines")
tile_size = self.getParameterValue(flightlinesToDTMandDSM.TILE_SIZE)
commands.append("-tile_size")
commands.append(str(tile_size))
buffer = self.getParameterValue(flightlinesToDTMandDSM.BUFFER)
if buffer != 0.0:
commands.append("-buffer")
commands.append(str(buffer))
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
base_name = self.getParameterValue(flightlinesToDTMandDSM.BASE_NAME)
if base_name == "":
base_name = "tile"
commands.append("-o")
commands.append(base_name)
commands.append("-olaz")
LAStoolsUtils.runLAStools(commands, progress)
# then we ground classify the tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*.laz")
method = self.getParameterValue(flightlinesToDTMandDSM.TERRAIN)
if method != 1:
commands.append("-" + flightlinesToDTMandDSM.TERRAINS[method])
if method > 2:
commands.append("-ultra_fine")
elif method > 1:
commands.append("-extra_fine")
elif method > 0:
commands.append("-fine")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("_g")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we rasterize the classified tiles into DTMs
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_g.laz")
commands.append("-keep_class")
commands.append("2")
self.addParametersStepCommands(commands)
commands.append("-use_tile_bb")
self.addParametersOutputDirectoryCommands(commands)
commands.append("-ocut")
commands.append("2")
commands.append("-odix")
commands.append("_dtm")
self.addParametersRasterOutputFormatCommands(commands)
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we rasterize the classified tiles into DSMs
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_g.laz")
commands.append("-first_only")
self.addParametersStepCommands(commands)
commands.append("-use_tile_bb")
self.addParametersOutputDirectoryCommands(commands)
commands.append("-ocut")
commands.append("2")
commands.append("-odix")
commands.append("_dsm")
self.addParametersRasterOutputFormatCommands(commands)
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,267 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
flightlinesToSingleCHMpitFree.py
---------------------
Date : May 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__ = 'May 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.parameters.ParameterSelection import ParameterSelection
from processing.parameters.ParameterNumber import ParameterNumber
class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
TILE_SIZE = "TILE_SIZE"
BUFFER = "BUFFER"
TERRAIN = "TERRAIN"
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
BEAM_WIDTH = "BEAM_WIDTH"
def defineCharacteristics(self):
self.name = "flightlinesToSingleCHMpitFree"
self.group = "LAStools Pipelines"
self.addParametersPointInputFolderGUI()
self.addParameter(ParameterNumber(flightlinesToSingleCHMpitFree.TILE_SIZE, "tile size (side length of square tile)", 0, None, 1000.0))
self.addParameter(ParameterNumber(flightlinesToSingleCHMpitFree.BUFFER, "buffer around each tile (avoids edge artifacts)", 0, None, 25.0))
self.addParameter(ParameterSelection(flightlinesToSingleCHMpitFree.TERRAIN, "terrain type", flightlinesToSingleCHMpitFree.TERRAINS, 1))
self.addParameter(ParameterNumber(flightlinesToSingleCHMpitFree.BEAM_WIDTH, "laser beam width (diameter of laser footprint)", 0, None, 0.2))
self.addParametersStepGUI()
self.addParametersTemporaryDirectoryGUI()
self.addParametersRasterOutputGUI()
self.addParametersCoresGUI()
self.addParametersVerboseGUI()
def processAlgorithm(self, progress):
# needed for thinning and killing
step = self.getParametersStepValue()
# first we tile the data
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
commands.append("-files_are_flightlines")
tile_size = self.getParameterValue(flightlinesToSingleCHMpitFree.TILE_SIZE)
commands.append("-tile_size")
commands.append(str(tile_size))
buffer = self.getParameterValue(flightlinesToSingleCHMpitFree.BUFFER)
if buffer != 0.0:
commands.append("-buffer")
commands.append(str(buffer))
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-o")
commands.append("tile.laz")
LAStoolsUtils.runLAStools(commands, progress)
# then we ground classify the tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*.laz")
method = self.getParameterValue(flightlinesToSingleCHMpitFree.TERRAIN)
if method != 1:
commands.append("-" + flightlinesToSingleCHMpitFree.TERRAINS[method])
if method > 2:
commands.append("-ultra_fine")
elif method > 1:
commands.append("-extra_fine")
elif method > 0:
commands.append("-fine")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("_g")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we height-normalize the tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_g.laz")
commands.append("-replace_z")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("h")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we thin and splat the tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_gh.laz")
beam_width = self.getParameterValue(flightlinesToSingleCHMpitFree.BEAM_WIDTH)
if beam_width != 0.0:
commands.append("-subcircle")
commands.append(str(beam_width/2))
commands.append("-step")
commands.append(str(step/4))
commands.append("-highest")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("t")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we rasterize the classified tiles into the partial CHMs at level 00
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
self.addParametersStepCommands(commands)
commands.append("-use_tile_bb")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-ocut")
commands.append("4")
commands.append("-odix")
commands.append("_chm00")
commands.append("-obil")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we rasterize the classified tiles into the partial CHMs at level 02
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
commands.append("-drop_z_below")
commands.append("2")
self.addParametersStepCommands(commands)
commands.append("-kill")
commands.append(str(step*3))
commands.append("-use_tile_bb")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-ocut")
commands.append("4")
commands.append("-odix")
commands.append("_chm02")
commands.append("-obil")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we rasterize the classified tiles into the partial CHMs at level 05
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
commands.append("-drop_z_below")
commands.append("5")
self.addParametersStepCommands(commands)
commands.append("-kill")
commands.append(str(step*3))
commands.append("-use_tile_bb")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-ocut")
commands.append("4")
commands.append("-odix")
commands.append("_chm05")
commands.append("-obil")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we rasterize the classified tiles into the partial CHMs at level 10
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
commands.append("-drop_z_below")
commands.append("10")
self.addParametersStepCommands(commands)
commands.append("-kill")
commands.append(str(step*3))
commands.append("-use_tile_bb")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-ocut")
commands.append("4")
commands.append("-odix")
commands.append("_chm10")
commands.append("-obil")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we rasterize the classified tiles into the partial CHMs at level 15
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
commands.append("-drop_z_below")
commands.append("15")
self.addParametersStepCommands(commands)
commands.append("-kill")
commands.append(str(step*3))
commands.append("-use_tile_bb")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-ocut")
commands.append("4")
commands.append("-odix")
commands.append("_chm15")
commands.append("-obil")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we rasterize the classified tiles into the partial CHMs at level 20
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
commands.append("-drop_z_below")
commands.append("20")
self.addParametersStepCommands(commands)
commands.append("-kill")
commands.append(str(step*3))
commands.append("-use_tile_bb")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-ocut")
commands.append("4")
commands.append("-odix")
commands.append("_chm20")
commands.append("-obil")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we combine the partial CHMs into a single output CHM
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasgrid.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile_chm*.bil")
commands.append("-highest")
self.addParametersStepCommands(commands)
self.addParametersRasterOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,135 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
hugeFileClassify.py
---------------------
Date : May 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__ = 'May 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterSelection import ParameterSelection
from processing.parameters.ParameterNumber import ParameterNumber
class hugeFileClassify(LAStoolsAlgorithm):
TILE_SIZE = "TILE_SIZE"
BUFFER = "BUFFER"
AIRBORNE = "AIRBORNE"
TERRAIN = "TERRAIN"
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
GRANULARITY = "GRANULARITY"
GRANULARITIES = ["coarse", "default", "fine", "extra_fine", "ultra_fine"]
def defineCharacteristics(self):
self.name = "hugeFileClassify"
self.group = "LAStools Pipelines"
self.addParametersPointInputGUI()
self.addParameter(ParameterNumber(hugeFileClassify.TILE_SIZE, "tile size (side length of square tile)", 0, None, 1000.0))
self.addParameter(ParameterNumber(hugeFileClassify.BUFFER, "buffer around each tile (avoids edge artifacts)", 0, None, 25.0))
self.addParameter(ParameterBoolean(hugeFileClassify.AIRBORNE, "airborne LiDAR", True))
self.addParameter(ParameterSelection(hugeFileClassify.TERRAIN, "terrain type", hugeFileClassify.TERRAINS, 1))
self.addParameter(ParameterSelection(hugeFileClassify.GRANULARITY, "preprocessing", hugeFileClassify.GRANULARITIES, 1))
self.addParametersTemporaryDirectoryGUI()
self.addParametersPointOutputGUI()
self.addParametersCoresGUI()
self.addParametersVerboseGUI()
def processAlgorithm(self, progress):
# first we tile the data with option '-reversible'
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
tile_size = self.getParameterValue(hugeFileClassify.TILE_SIZE)
commands.append("-tile_size")
commands.append(str(tile_size))
buffer = self.getParameterValue(hugeFileClassify.BUFFER)
if buffer != 0.0:
commands.append("-buffer")
commands.append(str(buffer))
commands.append("-reversible")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-o")
commands.append("hugeFileClassify.laz")
LAStoolsUtils.runLAStools(commands, progress)
# then we ground classify the reversible tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileClassify*.laz")
airborne = self.getParameterValue(hugeFileClassify.AIRBORNE)
if airborne != True:
commands.append("-not_airborne")
method = self.getParameterValue(hugeFileClassify.TERRAIN)
if method != 1:
commands.append("-" + hugeFileClassify.TERRAINS[method])
granularity = self.getParameterValue(hugeFileClassify.GRANULARITY)
if granularity != 1:
commands.append("-" + hugeFileClassify.GRANULARITIES[granularity])
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("_g")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we compute the height for each points in the reversible tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileClassify*_g.laz")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("h")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we classify buildings and trees in the reversible tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclassify.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileClassify*_gh.laz")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("c")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we reverse the tiling
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileClassify*_ghc.laz")
commands.append("-reverse_tiling")
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,109 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
hugeFileGroundClassify.py
---------------------
Date : May 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__ = 'May 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterSelection import ParameterSelection
from processing.parameters.ParameterNumber import ParameterNumber
class hugeFileGroundClassify(LAStoolsAlgorithm):
TILE_SIZE = "TILE_SIZE"
BUFFER = "BUFFER"
AIRBORNE = "AIRBORNE"
TERRAIN = "TERRAIN"
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
GRANULARITY = "GRANULARITY"
GRANULARITIES = ["coarse", "default", "fine", "extra_fine", "ultra_fine"]
def defineCharacteristics(self):
self.name = "hugeFileGroundClassify"
self.group = "LAStools Pipelines"
self.addParametersPointInputGUI()
self.addParameter(ParameterNumber(hugeFileGroundClassify.TILE_SIZE, "tile size (side length of square tile)", 0, None, 1000.0))
self.addParameter(ParameterNumber(hugeFileGroundClassify.BUFFER, "buffer around each tile (avoids edge artifacts)", 0, None, 25.0))
self.addParameter(ParameterBoolean(hugeFileGroundClassify.AIRBORNE, "airborne LiDAR", True))
self.addParameter(ParameterSelection(hugeFileGroundClassify.TERRAIN, "terrain type", hugeFileGroundClassify.TERRAINS, 1))
self.addParameter(ParameterSelection(hugeFileGroundClassify.GRANULARITY, "preprocessing", hugeFileGroundClassify.GRANULARITIES, 1))
self.addParametersTemporaryDirectoryGUI()
self.addParametersPointOutputGUI()
self.addParametersCoresGUI()
self.addParametersVerboseGUI()
def processAlgorithm(self, progress):
# first we tile the data with option '-reversible'
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
tile_size = self.getParameterValue(hugeFileGroundClassify.TILE_SIZE)
commands.append("-tile_size")
commands.append(str(tile_size))
buffer = self.getParameterValue(hugeFileGroundClassify.BUFFER)
if buffer != 0.0:
commands.append("-buffer")
commands.append(str(buffer))
commands.append("-reversible")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-o")
commands.append("hugeFileGroundClassify.laz")
LAStoolsUtils.runLAStools(commands, progress)
# then we ground classify the reversible tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileGroundClassify*.laz")
airborne = self.getParameterValue(hugeFileGroundClassify.AIRBORNE)
if airborne != True:
commands.append("-not_airborne")
method = self.getParameterValue(hugeFileGroundClassify.TERRAIN)
if method != 1:
commands.append("-" + hugeFileGroundClassify.TERRAINS[method])
granularity = self.getParameterValue(hugeFileGroundClassify.GRANULARITY)
if granularity != 1:
commands.append("-" + hugeFileGroundClassify.GRANULARITIES[granularity])
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("_g")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we reverse the tiling
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileGroundClassify*_g.laz")
commands.append("-reverse_tiling")
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,123 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
hugeFileNormalize.py
---------------------
Date : May 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__ = 'May 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterSelection import ParameterSelection
from processing.parameters.ParameterNumber import ParameterNumber
class hugeFileNormalize(LAStoolsAlgorithm):
TILE_SIZE = "TILE_SIZE"
BUFFER = "BUFFER"
AIRBORNE = "AIRBORNE"
TERRAIN = "TERRAIN"
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
GRANULARITY = "GRANULARITY"
GRANULARITIES = ["coarse", "default", "fine", "extra_fine", "ultra_fine"]
def defineCharacteristics(self):
self.name = "hugeFileNormalize"
self.group = "LAStools Pipelines"
self.addParametersPointInputGUI()
self.addParameter(ParameterNumber(hugeFileNormalize.TILE_SIZE, "tile size (side length of square tile)", 0, None, 1000.0))
self.addParameter(ParameterNumber(hugeFileNormalize.BUFFER, "buffer around each tile (avoids edge artifacts)", 0, None, 25.0))
self.addParameter(ParameterBoolean(hugeFileNormalize.AIRBORNE, "airborne LiDAR", True))
self.addParameter(ParameterSelection(hugeFileNormalize.TERRAIN, "terrain type", hugeFileNormalize.TERRAINS, 1))
self.addParameter(ParameterSelection(hugeFileNormalize.GRANULARITY, "preprocessing", hugeFileNormalize.GRANULARITIES, 1))
self.addParametersTemporaryDirectoryGUI()
self.addParametersPointOutputGUI()
self.addParametersCoresGUI()
self.addParametersVerboseGUI()
def processAlgorithm(self, progress):
# first we tile the data with option '-reversible'
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
tile_size = self.getParameterValue(hugeFileNormalize.TILE_SIZE)
commands.append("-tile_size")
commands.append(str(tile_size))
buffer = self.getParameterValue(hugeFileNormalize.BUFFER)
if buffer != 0.0:
commands.append("-buffer")
commands.append(str(buffer))
commands.append("-reversible")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-o")
commands.append("hugeFileNormalize.laz")
LAStoolsUtils.runLAStools(commands, progress)
# then we ground classify the reversible tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileNormalize*.laz")
airborne = self.getParameterValue(hugeFileNormalize.AIRBORNE)
if airborne != True:
commands.append("-not_airborne")
method = self.getParameterValue(hugeFileNormalize.TERRAIN)
if method != 1:
commands.append("-" + hugeFileNormalize.TERRAINS[method])
granularity = self.getParameterValue(hugeFileNormalize.GRANULARITY)
if granularity != 1:
commands.append("-" + hugeFileNormalize.GRANULARITIES[granularity])
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-odix")
commands.append("_g")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we height-normalize each points in the reversible tiles
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileNormalize*_g.laz")
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
commands.append("-replace_z")
commands.append("-odix")
commands.append("h")
commands.append("-olaz")
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)
# then we reverse the tiling
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileNormalize*_gh.laz")
commands.append("-reverse_tiling")
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -24,55 +24,47 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from LAStoolsUtils import LAStoolsUtils
from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterSelection import ParameterSelection
class las2dem(LAStoolsAlgorithm):
ATTRIBUTE = 'ATTRIBUTE'
PRODUCT = 'PRODUCT'
ATTRIBUTES = ['elevation', 'slope', 'intensity', 'rgb']
PRODUCTS = ['actual values', 'hillshade', 'gray', 'false']
ATTRIBUTE = "ATTRIBUTE"
PRODUCT = "PRODUCT"
ATTRIBUTES = ["elevation", "slope", "intensity", "rgb", "edge_longest", "edge_shortest"]
PRODUCTS = ["actual values", "hillshade", "gray", "false"]
def defineCharacteristics(self):
self.name = 'las2dem'
self.group = 'LAStools'
self.name = "las2dem"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
self.addParametersStepGUI()
self.addParameter(ParameterSelection(las2dem.ATTRIBUTE, 'Attribute',
las2dem.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(las2dem.PRODUCT, 'Product',
las2dem.PRODUCTS, 0))
self.addParameter(ParameterSelection(las2dem.ATTRIBUTE, "Attribute", las2dem.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(las2dem.PRODUCT, "Product", las2dem.PRODUCTS, 0))
self.addParametersRasterOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'las2dem.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersStepCommands(commands)
attribute = self.getParameterValue(las2dem.ATTRIBUTE)
if attribute != 0:
commands.append('-' + las2dem.ATTRIBUTES[attribute])
commands.append("-" + las2dem.ATTRIBUTES[attribute])
product = self.getParameterValue(las2dem.PRODUCT)
if product != 0:
commands.append('-' + las2dem.PRODUCTS[product])
commands.append("-" + las2dem.PRODUCTS[product])
self.addParametersRasterOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,78 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
las2demPro.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : September 2013
Copyright : (C) 2013 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__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# 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.parameters.ParameterSelection import ParameterSelection
class las2demPro(LAStoolsAlgorithm):
ATTRIBUTE = "ATTRIBUTE"
PRODUCT = "PRODUCT"
ATTRIBUTES = ["elevation", "slope", "intensity", "rgb", "edge_longest", "edge_shortest"]
PRODUCTS = ["actual values", "hillshade", "gray", "false"]
def defineCharacteristics(self):
self.name = "las2demPro"
self.group = "LAStools"
self.addParametersPointInputFolderGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
self.addParametersStepGUI()
self.addParameter(ParameterSelection(las2demPro.ATTRIBUTE, "attribute (what to interpolate)", las2demPro.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(las2demPro.PRODUCT, "product (how to output per pixel)", las2demPro.PRODUCTS, 0))
self.addParametersOutputDirectoryGUI()
self.addParametersOutputAppendixGUI()
self.addParametersRasterOutputFormatGUI()
self.addParametersAdditionalGUI()
self.addParametersCoresGUI()
self.addParametersVerboseGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersStepCommands(commands)
attribute = self.getParameterValue(las2demPro.ATTRIBUTE)
if attribute != 0:
commands.append("-" + las2demPro.ATTRIBUTES[attribute])
product = self.getParameterValue(las2demPro.PRODUCT)
if product != 0:
commands.append("-" + las2demPro.PRODUCTS[product])
self.addParametersOutputDirectoryCommands(commands)
self.addParametersOutputAppendixCommands(commands)
self.addParametersPointOutputFormatCommands(commands)
self.addParametersAdditionalCommands(commands)
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -24,9 +24,7 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -35,57 +33,47 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterNumber import ParameterNumber
class las2iso(LAStoolsAlgorithm):
SMOOTH = 'SMOOTH'
ISO_EVERY = 'ISO_EVERY'
SIMPLIFY_LENGTH = 'SIMPLIFY_LENGTH'
SIMPLIFY_AREA = 'SIMPLIFY_AREA'
CLEAN = 'CLEAN'
SMOOTH = "SMOOTH"
ISO_EVERY = "ISO_EVERY"
SIMPLIFY_LENGTH = "SIMPLIFY_LENGTH"
SIMPLIFY_AREA = "SIMPLIFY_AREA"
CLEAN = "CLEAN"
def defineCharacteristics(self):
self.name = 'las2iso'
self.group = 'LAStools'
self.name = "las2iso"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterNumber(las2iso.SMOOTH,
'smooth underlying TIN', 0, None, 0))
self.addParameter(ParameterNumber(las2iso.ISO_EVERY,
'extract isoline with a spacing of', 0, None, 10.0))
self.addParameter(ParameterNumber(las2iso.CLEAN,
'clean isolines shorter than (0 = do not clean)',
None, None, 0.0))
self.addParameter(ParameterNumber(las2iso.SIMPLIFY_LENGTH,
'simplify segments shorter than (0 = do not simplify)',
None, None, 0.0))
self.addParameter(ParameterNumber(las2iso.SIMPLIFY_AREA,
"simplify segments pairs with area less than (0 = don't simplify)",
None, None, 0.0))
self.addParameter(ParameterNumber(las2iso.SMOOTH, "smooth underlying TIN", 0, None, 0))
self.addParameter(ParameterNumber(las2iso.ISO_EVERY, "extract isoline with a spacing of", 0, None, 10.0))
self.addParameter(ParameterNumber(las2iso.CLEAN, "clean isolines shorter than (0 = do not clean)", None, None, 0.0))
self.addParameter(ParameterNumber(las2iso.SIMPLIFY_LENGTH, "simplify segments shorter than (0 = do not simplify)", None, None, 0.0))
self.addParameter(ParameterNumber(las2iso.SIMPLIFY_AREA, "simplify segments pairs with area less than (0 = do not simplify)", None, None, 0.0))
self.addParametersVectorOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'las2iso.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2iso.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersPointInputCommands(commands)
smooth = self.getParameterValue(las2iso.SMOOTH)
if smooth != 0:
commands.append('-smooth')
commands.append("-smooth")
commands.append(str(smooth))
commands.append('-iso_every')
commands.append("-iso_every")
commands.append(str(self.getParameterValue(las2iso.ISO_EVERY)))
simplify_length = self.getParameterValue(las2iso.SIMPLIFY_LENGTH)
if simplify_length != 0:
commands.append('-simplify_length')
commands.append("-simplify_length")
commands.append(str(simplify_length))
simplify_area = self.getParameterValue(las2iso.SIMPLIFY_AREA)
if simplify_area != 0:
commands.append('-simplify_area')
commands.append("-simplify_area")
commands.append(str(simplify_area))
clean = self.getParameterValue(las2iso.CLEAN)
if clean != 0:
commands.append('-clean')
commands.append("-clean")
commands.append(str(clean))
self.addParametersVectorOutputCommands(commands)

View File

@ -20,72 +20,50 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterSelection import ParameterSelection
class las2las(LAStoolsAlgorithm):
STEP = 'STEP'
OPERATION = 'OPERATION'
OPERATIONS = [
'---',
'set_point_type',
'set_point_size',
'set_version_minor',
'set_version_major',
'start_at_point',
'stop_at_point',
'remove_vlr',
'auto_reoffset',
'week_to_adjusted',
'adjusted_to_week',
'scale_rgb_up',
'scale_rgb_down',
'remove_all_vlrs',
'remove_extra',
'clip_to_bounding_box',
]
OPERATIONARG = 'OPERATIONARG'
STEP = "STEP"
OPERATION = "OPERATION"
OPERATIONS = ["---", "set_point_type", "set_point_size", "set_version_minor", "set_version_major",
"start_at_point", "stop_at_point", "remove_vlr", "auto_reoffset", "week_to_adjusted",
"adjusted_to_week", "scale_rgb_up", "scale_rgb_down", "remove_all_vlrs", "remove_extra",
"clip_to_bounding_box"]
OPERATIONARG = "OPERATIONARG"
def defineCharacteristics(self):
self.name = 'las2las'
self.group = 'LAStools'
self.name = "las2las"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
self.addParametersFilter1CoordsIntensityGUI()
self.addParameter(ParameterSelection(las2las.OPERATION,
'operations (first 7 need an argument)',
las2las.OPERATIONS, 0))
self.addParameter(ParameterString(las2las.OPERATIONARG,
'argument for operation'))
self.addParameter(ParameterSelection(las2las.OPERATION, "operations (first 7 need an argument)", las2las.OPERATIONS, 0))
self.addParameter(ParameterString(las2las.OPERATIONARG, "argument for operation"))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'las2las.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersFilter1CoordsIntensityCommands(commands)
operation = self.getParameterValue(las2las.OPERATION)
if operation != 0:
commands.append('-' + OPERATIONS[operation])
commands.append("-" + OPERATIONS[operation])
if operation > 7:
commands.append(self.getParameterValue(las2las.OPERATIONARG))
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,26 +20,19 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterSelection import ParameterSelection
class las2las_filter(LAStoolsAlgorithm):
def defineCharacteristics(self):
self.name = 'las2las_filter'
self.group = 'LAStools'
self.name = "las2las_filter"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
@ -48,16 +41,16 @@ class las2las_filter(LAStoolsAlgorithm):
self.addParametersFilter2CoordsIntensityGUI()
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'las2las.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersFilter2ReturnClassFlagsCommands(commands)
self.addParametersFilter1CoordsIntensityCommands(commands)
self.addParametersFilter2CoordsIntensityCommands(commands)
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,105 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
las2las_project.py
---------------------
Date : September 2013
Copyright : (C) 2013 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__ = 'September 2013'
__copyright__ = '(C) 2013, 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterSelection import ParameterSelection
class las2las_project(LAStoolsAlgorithm):
STATE_PLANES = ["---", "AK_10", "AK_2", "AK_3", "AK_4", "AK_5", "AK_6", "AK_7", "AK_8", "AK_9", "AL_E", "AL_W", "AR_N", "AR_S", "AZ_C", "AZ_E", "AZ_W", "CA_I", "CA_II", "CA_III", "CA_IV", "CA_V", "CA_VI", "CA_VII", "CO_C", "CO_N", "CO_S", "CT", "DE", "FL_E", "FL_N", "FL_W", "GA_E", "GA_W", "HI_1", "HI_2", "HI_3", "HI_4", "HI_5", "IA_N", "IA_S", "ID_C", "ID_E", "ID_W", "IL_E", "IL_W", "IN_E", "IN_W", "KS_N", "KS_S", "KY_N", "KY_S", "LA_N", "LA_S", "MA_I", "MA_M", "MD", "ME_E", "ME_W", "MI_C", "MI_N", "MI_S", "MN_C", "MN_N", "MN_S", "MO_C", "MO_E", "MO_W", "MS_E", "MS_W", "MT_C", "MT_N", "MT_S", "NC", "ND_N", "ND_S", "NE_N", "NE_S", "NH", "NJ", "NM_C", "NM_E", "NM_W", "NV_C", "NV_E", "NV_W", "NY_C", "NY_E", "NY_LI", "NY_W", "OH_N", "OH_S", "OK_N", "OK_S", "OR_N", "OR_S", "PA_N", "PA_S", "PR", "RI", "SC_N", "SC_S", "SD_N", "SD_S", "St.Croix", "TN", "TX_C", "TX_N", "TX_NC", "TX_S", "TX_SC", "UT_C", "UT_N", "UT_S", "VA_N", "VA_S", "VT", "WA_N", "WA_S", "WI_C", "WI_N", "WI_S", "WV_N", "WV_S", "WY_E", "WY_EC", "WY_W", "WY_WC"]
UTM_ZONES = ["---", "1 (north)", "2 (north)", "3 (north)", "4 (north)", "5 (north)", "6 (north)", "7 (north)", "8 (north)", "9 (north)", "10 (north)", "11 (north)", "12 (north)", "13 (north)", "14 (north)", "15 (north)", "16 (north)", "17 (north)", "18 (north)", "19 (north)", "20 (north)", "21 (north)", "22 (north)", "23 (north)", "24 (north)", "25 (north)", "26 (north)", "27 (north)", "28 (north)", "29 (north)", "30 (north)", "31 (north)", "32 (north)", "33 (north)", "34 (north)", "35 (north)", "36 (north)", "37 (north)", "38 (north)", "39 (north)", "40 (north)", "41 (north)", "42 (north)", "43 (north)", "44 (north)", "45 (north)", "46 (north)", "47 (north)", "48 (north)", "49 (north)", "50 (north)", "51 (north)", "52 (north)", "53 (north)", "54 (north)", "55 (north)", "56 (north)", "57 (north)", "58 (north)", "59 (north)", "60 (north)", "1 (south)", "2 (south)", "3 (south)", "4 (south)", "5 (south)", "6 (south)", "7 (south)", "8 (south)", "9 (south)", "10 (south)", "11 (south)", "12 (south)", "13 (south)", "14 (south)", "15 (south)", "16 (south)", "17 (south)", "18 (south)", "19 (south)", "20 (south)", "21 (south)", "22 (south)", "23 (south)", "24 (south)", "25 (south)", "26 (south)", "27 (south)", "28 (south)", "29 (south)", "30 (south)", "31 (south)", "32 (south)", "33 (south)", "34 (south)", "35 (south)", "36 (south)", "37 (south)", "38 (south)", "39 (south)", "40 (south)", "41 (south)", "42 (south)", "43 (south)", "44 (south)", "45 (south)", "46 (south)", "47 (south)", "48 (south)", "49 (south)", "50 (south)", "51 (south)", "52 (south)", "53 (south)", "54 (south)", "55 (south)", "56 (south)", "57 (south)", "58 (south)", "59 (south)", "60 (south)"]
PROJECTIONS = ["---", "utm", "sp83", "sp27", "longlat", "latlong"]
SOURCE_PROJECTION = "SOURCE_PROJECTION"
SOURCE_UTM = "SOURCE_UTM"
SOURCE_SP = "SOURCE_SP"
TARGET_PROJECTION = "TARGET_PROJECTION"
TARGET_UTM = "TARGET_UTM"
TARGET_SP = "TARGET_SP"
def defineCharacteristics(self):
self.name = "las2las_project"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterSelection(las2las_project.SOURCE_PROJECTION, "source projection", las2las_project.PROJECTIONS, 0))
self.addParameter(ParameterSelection(las2las_project.SOURCE_UTM, "source utm zone", las2las_project.UTM_ZONES, 0))
self.addParameter(ParameterSelection(las2las_project.SOURCE_SP, "source state plane code", las2las_project.STATE_PLANES, 0))
self.addParameter(ParameterSelection(las2las_project.TARGET_PROJECTION, "target projection", las2las_project.PROJECTIONS, 0))
self.addParameter(ParameterSelection(las2las_project.TARGET_UTM, "target utm zone", las2las_project.UTM_ZONES, 0))
self.addParameter(ParameterSelection(las2las_project.TARGET_SP, "target state plane code", las2las_project.STATE_PLANES, 0))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
source_projection = self.getParameterValue(las2las_project.SOURCE_PROJECTION)
if source_projection != 0:
if source_projection == 1:
source_utm_zone = self.getParameterValue(las2las_project.SOURCE_UTM)
if source_utm_zone != 0:
commands.append("-" + las2las_project.PROJECTIONS[source_projection])
if source_utm_zone > 60:
commands.append(str(source_utm_zone - 1) + "N")
else:
commands.append(str(source_utm_zone - 1) + "K")
elif source_projection < 4:
source_sp_code = self.getParameterValue(las2las_project.SOURCE_SP)
if source_sp_code != 0:
commands.append("-" + las2las_project.PROJECTIONS[source_projection])
commands.append(las2las_project.STATE_PLANES[source_sp_code])
else:
commands.append("-" + las2las_project.PROJECTIONS[source_projection])
target_projection = self.getParameterValue(las2las_project.TARGET_PROJECTION)
if target_projection != 0:
if target_projection == 1:
target_utm_zone = self.getParameterValue(las2las_project.TARGET_UTM)
if target_utm_zone != 0:
commands.append("-target_" + las2las_project.PROJECTIONS[target_projection])
if target_utm_zone > 60:
commands.append(str(target_utm_zone - 1) + "N")
else:
commands.append(str(target_utm_zone - 1) + "K")
elif target_projection < 4:
target_sp_code = self.getParameterValue(las2las_project.TARGET_SP)
if target_sp_code != 0:
commands.append("-target_" + las2las_project.PROJECTIONS[target_projection])
commands.append(las2las_project.STATE_PLANES[target_sp_code])
else:
commands.append("-target_" + las2las_project.PROJECTIONS[target_projection])
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,64 +20,38 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterSelection import ParameterSelection
class las2las_transform(LAStoolsAlgorithm):
STEP = 'STEP'
OPERATION = 'OPERATION'
OPERATIONS = [
'---',
'set_point_type',
'set_point_size',
'set_version_minor',
'set_version_major',
'start_at_point',
'stop_at_point',
'remove_vlr',
'auto_reoffset',
'week_to_adjusted',
'adjusted_to_week',
'scale_rgb_up',
'scale_rgb_down',
'remove_all_vlrs',
'remove_extra',
'clip_to_bounding_box',
]
OPERATIONARG = 'OPERATIONARG'
OPERATION = "OPERATION"
OPERATIONS = ["---", "set_point_type", "set_point_size", "set_version_minor", "set_version_major", "start_at_point", "stop_at_point", "remove_vlr", "auto_reoffset", "week_to_adjusted", "adjusted_to_week", "scale_rgb_up", "scale_rgb_down", "remove_all_vlrs", "remove_extra", "clip_to_bounding_box"]
OPERATIONARG = "OPERATIONARG"
def defineCharacteristics(self):
self.name = 'las2las_transform'
self.group = 'LAStools'
self.name = "las2las_transform"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersTransform1CoordinateGUI()
self.addParametersTransform2CoordinateGUI()
self.addParametersTransform1OtherGUI()
self.addParametersTransform2OtherGUI()
self.addParameter(ParameterSelection(las2las_transform.OPERATION,
'operations (first 7 need an argument)',
las2las_transform.OPERATIONS, 0))
self.addParameter(ParameterString(las2las_transform.OPERATIONARG,
'argument for operation'))
self.addParameter(ParameterSelection(las2las_transform.OPERATION, "operations (first 7 need an argument)", las2las_transform.OPERATIONS, 0))
self.addParameter(ParameterString(las2las_transform.OPERATIONARG, "argument for operation"))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'las2las.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersTransform1CoordinateCommands(commands)
@ -86,11 +60,10 @@ class las2las_transform(LAStoolsAlgorithm):
self.addParametersTransform2OtherCommands(commands)
operation = self.getParameterValue(las2las_transform.OPERATION)
if operation != 0:
commands.append('-' + las2las_transform.OPERATIONS[operation])
commands.append("-" + las2las_transform.OPERATIONS[operation])
if operation > 7:
commands.append(self.getParameterValue(
las2las_transform.OPERATIONARG))
commands.append(self.getParameterValue(las2las_transform.OPERATIONARG))
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -33,36 +31,32 @@ from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.outputs.OutputFile import OutputFile
class las2shp(LAStoolsAlgorithm):
POINT_Z = 'POINT_Z'
RECORD_SIZE = 'RECORD_SIZE'
OUTPUT = 'OUTPUT'
POINT_Z = "POINT_Z"
RECORD_SIZE = "RECORD_SIZE"
OUTPUT = "OUTPUT"
def defineCharacteristics(self):
self.name = 'las2shp'
self.group = 'LAStools'
self.name = "las2shp"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterBoolean(las2shp.POINT_Z,
'use PointZ instead of MultiPointZ', False))
self.addParameter(ParameterNumber(las2shp.RECORD_SIZE,
'number of points per record', 0, None, 1024))
self.addOutput(OutputFile(las2shp.OUTPUT, 'Output SHP file'))
self.addParameter(ParameterBoolean(las2shp.POINT_Z, "use PointZ instead of MultiPointZ", False))
self.addParameter(ParameterNumber(las2shp.RECORD_SIZE, "number of points per record", 0, None, 1024))
self.addOutput(OutputFile(las2shp.OUTPUT, "Output SHP file"))
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'las2shp.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2shp.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
if self.getParameterValue(las2shp.POINT_Z):
commands.append('-single_points')
commands.append("-single_points")
record_size = self.getParameterValue(las2shp.RECORD_SIZE)
if record_size != 1024:
commands.append('-record_size')
commands.append("-record_size")
commands.append(str(record_size))
commands.append('-o')
commands.append("-o")
commands.append(self.getOutputValue(las2shp.OUTPUT))
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
las2tin.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : March 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__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# 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.parameters.ParameterNumber import ParameterNumber
class las2tin(LAStoolsAlgorithm):
def defineCharacteristics(self):
self.name = "las2tin"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
self.addParametersVectorOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2tin.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersVectorOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,44 +20,38 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterString import ParameterString
from processing.outputs.OutputFile import OutputFile
class las2txt(LAStoolsAlgorithm):
PARSE_STRING = 'PARSE_STRING'
OUTPUT = 'OUTPUT'
PARSE_STRING = "PARSE_STRING"
OUTPUT = "OUTPUT"
def defineCharacteristics(self):
self.name = 'las2txt'
self.group = 'LAStools'
self.name = "las2txt"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterString(las2txt.PARSE_STRING, 'parse_string'
, 'xyz'))
self.addOutput(OutputFile(las2txt.OUTPUT, 'Output ASCII file'))
self.addParameter(ParameterString(las2txt.PARSE_STRING, "parse_string", "xyz"))
self.addOutput(OutputFile(las2txt.OUTPUT, "Output ASCII file"))
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'las2txt.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
parse_string = self.getParameterValue(las2txt.PARSE_STRING)
if parse_string != 'xyz':
commands.append('-parse_string')
if parse_string != "xyz":
commands.append("-parse_string")
commands.append(parse_string)
commands.append('-o')
commands.append("-o")
commands.append(self.getOutputValue(las2txt.OUTPUT))
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -24,9 +24,7 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -36,42 +34,36 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
class lasboundary(LAStoolsAlgorithm):
CONCAVITY = 'CONCAVITY'
DISJOINT = 'DISJOINT'
HOLES = 'HOLES'
CONCAVITY = "CONCAVITY"
DISJOINT = "DISJOINT"
HOLES = "HOLES"
def defineCharacteristics(self):
self.name = 'lasboundary'
self.group = 'LAStools'
self.name = "lasboundary"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
self.addParameter(ParameterNumber(lasboundary.CONCAVITY, 'concavity',
0, None, 50.0))
self.addParameter(ParameterBoolean(lasboundary.HOLES, 'interior holes'
, False))
self.addParameter(ParameterBoolean(lasboundary.DISJOINT,
'disjoint polygon', False))
self.addParameter(ParameterNumber(lasboundary.CONCAVITY, "concavity", 0, None, 50.0))
self.addParameter(ParameterBoolean(lasboundary.HOLES, "interior holes", False))
self.addParameter(ParameterBoolean(lasboundary.DISJOINT, "disjoint polygon", False))
self.addParametersVectorOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasboundary.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasboundary.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
concavity = self.getParameterValue(lasboundary.CONCAVITY)
commands.append('-concavity')
commands.append("-concavity")
commands.append(str(concavity))
if self.getParameterValue(lasboundary.HOLES):
commands.append('-holes')
commands.append("-holes")
if self.getParameterValue(lasboundary.DISJOINT):
commands.append('-disjoint')
commands.append("-disjoint")
self.addParametersVectorOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,13 +20,10 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from LAStoolsUtils import LAStoolsUtils
from LAStoolsAlgorithm import LAStoolsAlgorithm
@ -35,96 +32,78 @@ from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterSelection import ParameterSelection
class lascanopy(LAStoolsAlgorithm):
HEIGHT_CUTOFF = 'HEIGHT_CUTOFF'
ATTRIBUTE = 'ATTRIBUTE'
PRODUCT1 = 'PRODUCT1'
PRODUCT2 = 'PRODUCT2'
PRODUCT3 = 'PRODUCT3'
PRODUCT4 = 'PRODUCT4'
PRODUCT5 = 'PRODUCT5'
PRODUCT6 = 'PRODUCT6'
PRODUCT7 = 'PRODUCT7'
PRODUCT8 = 'PRODUCT8'
PRODUCT9 = 'PRODUCT9'
PRODUCTS = [
'---', 'min', 'max', 'avg', 'std', 'ske', 'kur', 'cov', 'dns', 'p01',
'p05', 'p10', 'p25', 'p50', 'p75', 'p90', 'p99'
]
COUNTS = 'COUNTS'
DENSITIES = 'DENSITIES'
USE_TILE_BB = 'USE_TILE_BB'
HEIGHT_CUTOFF = "HEIGHT_CUTOFF"
ATTRIBUTE = "ATTRIBUTE"
PRODUCT1 = "PRODUCT1"
PRODUCT2 = "PRODUCT2"
PRODUCT3 = "PRODUCT3"
PRODUCT4 = "PRODUCT4"
PRODUCT5 = "PRODUCT5"
PRODUCT6 = "PRODUCT6"
PRODUCT7 = "PRODUCT7"
PRODUCT8 = "PRODUCT8"
PRODUCT9 = "PRODUCT9"
PRODUCTS = ["---", "min", "max", "avg", "std", "ske", "kur", "cov", "dns",
"p01", "p05", "p10", "p25", "p50", "p75", "p90", "p99"]
COUNTS = "COUNTS"
DENSITIES = "DENSITIES"
USE_TILE_BB = "USE_TILE_BB"
def defineCharacteristics(self):
self.name = 'lascanopy'
self.group = 'LAStools'
self.name = "lascanopy"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersStepGUI()
self.addParameter(ParameterNumber(lascanopy.HEIGHT_CUTOFF,
'height cutoff / breast height', False, False, 1.37))
self.addParameter(ParameterSelection(lascanopy.PRODUCT1, 'create',
lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT2, 'create',
lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT3, 'create',
lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT4, 'create',
lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT5, 'create',
lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT6, 'create',
lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT7, 'create',
lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT8, 'create',
lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT9, 'create',
lascanopy.PRODUCTS, 0))
self.addParameter(ParameterString(lascanopy.COUNTS,
'count rasters (e.g. 2.0 5.0 10.0 20.0)', ''))
self.addParameter(ParameterString(lascanopy.DENSITIES,
'density rasters (e.g. 2.0 5.0 10.0 20.0)', ''))
self.addParameter(ParameterBoolean(lascanopy.USE_TILE_BB,
'use tile bounding box (after tiling with buffer)',
False))
self.addParameter(ParameterNumber(lascanopy.HEIGHT_CUTOFF, "height cutoff / breast height", 0, None, 1.37))
self.addParameter(ParameterSelection(lascanopy.PRODUCT1, "create", lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT2, "create", lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT3, "create", lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT4, "create", lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT5, "create", lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT6, "create", lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT7, "create", lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT8, "create", lascanopy.PRODUCTS, 0))
self.addParameter(ParameterSelection(lascanopy.PRODUCT9, "create", lascanopy.PRODUCTS, 0))
self.addParameter(ParameterString(lascanopy.COUNTS, "count rasters (e.g. 2.0 5.0 10.0 20.0)", ""))
self.addParameter(ParameterString(lascanopy.DENSITIES, "density rasters (e.g. 2.0 5.0 10.0 20.0)", ""))
self.addParameter(ParameterBoolean(lascanopy.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
self.addParametersRasterOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lascanopy.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascanopy.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersStepCommands(commands)
product = self.getParameterValue(lascanopy.PRODUCT1)
if product != 0:
commands.append('-' + lascanopy.PRODUCTS[product])
commands.append("-" + lascanopy.PRODUCTS[product])
product = self.getParameterValue(lascanopy.PRODUCT2)
if product != 0:
commands.append('-' + lascanopy.PRODUCTS[product])
commands.append("-" + lascanopy.PRODUCTS[product])
product = self.getParameterValue(lascanopy.PRODUCT3)
if product != 0:
commands.append('-' + lascanopy.PRODUCTS[product])
commands.append("-" + lascanopy.PRODUCTS[product])
product = self.getParameterValue(lascanopy.PRODUCT4)
if product != 0:
commands.append('-' + lascanopy.PRODUCTS[product])
commands.append("-" + lascanopy.PRODUCTS[product])
product = self.getParameterValue(lascanopy.PRODUCT5)
if product != 0:
commands.append('-' + lascanopy.PRODUCTS[product])
commands.append("-" + lascanopy.PRODUCTS[product])
product = self.getParameterValue(lascanopy.PRODUCT6)
if product != 0:
commands.append('-' + lascanopy.PRODUCTS[product])
commands.append("-" + lascanopy.PRODUCTS[product])
product = self.getParameterValue(lascanopy.PRODUCT7)
if product != 0:
commands.append('-' + lascanopy.PRODUCTS[product])
commands.append("-" + lascanopy.PRODUCTS[product])
product = self.getParameterValue(lascanopy.PRODUCT8)
if product != 0:
commands.append('-' + lascanopy.PRODUCTS[product])
commands.append("-" + lascanopy.PRODUCTS[product])
product = self.getParameterValue(lascanopy.PRODUCT9)
if product != 0:
commands.append('-' + lascanopy.PRODUCTS[product])
commands.append("-" + lascanopy.PRODUCTS[product])
self.addParametersRasterOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -24,32 +24,28 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# 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
class lasclassify(LAStoolsAlgorithm):
def defineCharacteristics(self):
self.name = 'lasclassify'
self.group = 'LAStools'
self.name = "lasclassify"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersHorizontalAndVerticalFeetGUI()
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasclassify.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclassify.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersHorizontalAndVerticalFeetCommands(commands)
self.addParametersHorizontalAndVerticalFeetCommands(commands)
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -24,9 +24,7 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -38,45 +36,38 @@ from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterSelection import ParameterSelection
class lasclip(LAStoolsAlgorithm):
POLYGON = 'POLYGON'
INTERIOR = 'INTERIOR'
OPERATION = 'OPERATION'
OPERATIONS = ['clip', 'classify']
CLASSIFY_AS = 'CLASSIFY_AS'
POLYGON = "POLYGON"
INTERIOR = "INTERIOR"
OPERATION = "OPERATION"
OPERATIONS = ["clip", "classify"]
CLASSIFY_AS = "CLASSIFY_AS"
def defineCharacteristics(self):
self.name = 'lasclip'
self.group = 'LAStools'
self.addParametersVerboseGUI()
self.name = "lasclip"
self.group = "LAStools"
self.addParametersVerboseGUI();
self.addParametersPointInputGUI()
self.addParameter(ParameterVector(lasclip.POLYGON, 'Input polygon(s)',
ParameterVector.VECTOR_TYPE_POLYGON))
self.addParameter(ParameterBoolean(lasclip.INTERIOR, 'interior',
False))
self.addParameter(ParameterSelection(lasclip.OPERATION,
'what to do with isolated points',
lasclip.OPERATIONS, 0))
self.addParameter(ParameterNumber(lasclip.CLASSIFY_AS, 'classify as',
0, None, 12))
self.addParameter(ParameterVector(lasclip.POLYGON, "Input polygon(s)", ParameterVector.VECTOR_TYPE_POLYGON))
self.addParameter(ParameterBoolean(lasclip.INTERIOR, "interior", False))
self.addParameter(ParameterSelection(lasclip.OPERATION, "what to do with points", lasclip.OPERATIONS, 0))
self.addParameter(ParameterNumber(lasclip.CLASSIFY_AS, "classify as", 0, None, 12))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasclip.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclip.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
poly = self.getParameterValue(lasclip.POLYGON)
if poly is not None:
commands.append('-poly')
if poly != None:
commands.append("-poly")
commands.append(poly)
if self.getParameterValue(lasclip.INTERIOR):
commands.append('-interior')
commands.append("-interior")
operation = self.getParameterValue(lasclip.OPERATION)
if operation != 0:
commands.append('-classify')
commands.append("-classify")
classify_as = self.getParameterValue(lasclip.CLASSIFY_AS)
commands.append(str(classify_as))
self.addParametersPointOutputCommands(commands)

View File

@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
lasclip.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : March 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__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# 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.parameters.ParameterRaster import ParameterRaster
class lascolor(LAStoolsAlgorithm):
ORTHO = "ORTHO"
def defineCharacteristics(self):
self.name = "lascolor"
self.group = "LAStools"
self.addParametersVerboseGUI();
self.addParametersPointInputGUI()
self.addParameter(ParameterRaster(lascolor.ORTHO, "Input ortho"))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascolor.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
ortho = self.getParameterValue(lascolor.ORTHO)
if ortho != None:
commands.append("-image")
commands.append(ortho)
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -34,46 +32,38 @@ from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterSelection import ParameterSelection
class lascontrol(LAStoolsAlgorithm):
POLYGON = 'POLYGON'
INTERIOR = 'INTERIOR'
OPERATION = 'OPERATION'
OPERATIONS = ['clip', 'classify']
CLASSIFY_AS = 'CLASSIFY_AS'
POLYGON = "POLYGON"
INTERIOR = "INTERIOR"
OPERATION = "OPERATION"
OPERATIONS = ["clip", "classify"]
CLASSIFY_AS = "CLASSIFY_AS"
def defineCharacteristics(self):
self.name = 'lascontrol'
self.group = 'LAStools'
self.addParametersVerboseGUI()
self.name = "lascontrol"
self.group = "LAStools"
self.addParametersVerboseGUI();
self.addParametersPointInputGUI()
self.addParameter(ParameterVector(lascontrol.POLYGON,
'Input polygon(s)',
ParameterVector.VECTOR_TYPE_POLYGON))
self.addParameter(ParameterBoolean(lascontrol.INTERIOR, 'interior',
False))
self.addParameter(ParameterSelection(lascontrol.OPERATION,
'what to do with isolated points',
lascontrol.OPERATIONS, 0))
self.addParameter(ParameterNumber(lascontrol.CLASSIFY_AS, 'classify as'
, 0, None, 12))
self.addParameter(ParameterVector(lascontrol.POLYGON, "Input polygon(s)", ParameterVector.VECTOR_TYPE_POLYGON))
self.addParameter(ParameterBoolean(lascontrol.INTERIOR, "interior", False))
self.addParameter(ParameterSelection(lascontrol.OPERATION, "what to do with isolated points", lascontrol.OPERATIONS, 0))
self.addParameter(ParameterNumber(lascontrol.CLASSIFY_AS, "classify as", 0, None, 12))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lascontrol.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascontrol.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
poly = self.getParameterValue(lascontrol.POLYGON)
if poly is not None:
commands.append('-poly')
if poly != None:
commands.append("-poly")
commands.append(poly)
if self.getParameterValue(lascontrol.INTERIOR):
commands.append('-interior')
commands.append("-interior")
operation = self.getParameterValue(lascontrol.OPERATION)
if operation != 0:
commands.append('-classify')
commands.append("-classify")
classify_as = self.getParameterValue(lascontrol.CLASSIFY_AS)
commands.append(str(classify_as))
self.addParametersPointOutputCommands(commands)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -32,43 +30,38 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterFile import ParameterFile
class lasduplicate(LAStoolsAlgorithm):
LOWEST_Z = 'LOWEST_Z'
UNIQUE_XYZ = 'UNIQUE_XYZ'
SINGLE_RETURNS = 'SINGLE_RETURNS'
RECORD_REMOVED = 'RECORD_REMOVED'
LOWEST_Z = "LOWEST_Z"
UNIQUE_XYZ = "UNIQUE_XYZ"
SINGLE_RETURNS = "SINGLE_RETURNS"
RECORD_REMOVED = "RECORD_REMOVED"
def defineCharacteristics(self):
self.name = 'lasduplicate'
self.group = 'LAStools'
self.name = "lasduplicate"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterBoolean(lasduplicate.LOWEST_Z,
'keep duplicate with lowest z coordinate', False))
self.addParameter(ParameterBoolean(lasduplicate.UNIQUE_XYZ,
'only remove duplicates in x y and z', False))
self.addParameter(ParameterBoolean(lasduplicate.SINGLE_RETURNS,
'mark surviving duplicate as single return', False))
self.addParameter(ParameterFile(lasduplicate.RECORD_REMOVED,
'record removed duplictates to LAS/LAZ file'))
self.addParameter(ParameterBoolean(lasduplicate.LOWEST_Z, "keep duplicate with lowest z coordinate", False))
self.addParameter(ParameterBoolean(lasduplicate.UNIQUE_XYZ, "only remove duplicates in x y and z", False))
self.addParameter(ParameterBoolean(lasduplicate.SINGLE_RETURNS, "mark surviving duplicate as single return", False))
self.addParameter(ParameterFile(lasduplicate.RECORD_REMOVED, "record removed duplictates to LAS/LAZ file"))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasduplicate.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasduplicate.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
if self.getParameterValue(lasduplicate.LOWEST_Z):
commands.append('-lowest_z')
commands.append("-lowest_z")
if self.getParameterValue(lasduplicate.UNIQUE_XYZ):
commands.append('-unique_xyz')
commands.append("-unique_xyz")
if self.getParameterValue(lasduplicate.SINGLE_RETURNS):
commands.append('-single_returns')
commands.append("-single_returns")
record_removed = self.getParameterValue(lasduplicate.RECORD_REMOVED)
if record_removed != Null:
commands.append('-record_removed')
if record_removed is not None and record_removed != "":
commands.append("-record_removed")
commands.append(record_removed)
self.addParametersPointOutputCommands(commands)

View File

@ -24,54 +24,45 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from LAStoolsUtils import LAStoolsUtils
from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterSelection import ParameterSelection
class lasgrid(LAStoolsAlgorithm):
ATTRIBUTE = 'ATTRIBUTE'
METHOD = 'METHOD'
ATTRIBUTES = ['elevation', 'intensity', 'rgb', 'classification']
METHODS = ['lowest', 'highest', 'average', 'stddev']
ATTRIBUTE = "ATTRIBUTE"
METHOD = "METHOD"
ATTRIBUTES = ["elevation", "intensity", "rgb", "classification"]
METHODS = ["lowest", "highest", "average", "stddev"]
def defineCharacteristics(self):
self.name = 'lasgrid'
self.group = 'LAStools'
self.name = "lasgrid"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
self.addParametersStepGUI()
self.addParameter(ParameterSelection(lasgrid.ATTRIBUTE, 'Attribute',
lasgrid.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(lasgrid.METHOD, 'Method',
lasgrid.METHODS, 0))
self.addParameter(ParameterSelection(lasgrid.ATTRIBUTE, "Attribute", lasgrid.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(lasgrid.METHOD, "Method", lasgrid.METHODS, 0))
self.addParametersRasterOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasgrid.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasgrid.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersStepCommands(commands)
attribute = self.getParameterValue(lasgrid.ATTRIBUTE)
if attribute != 0:
commands.append('-' + lasgrid.ATTRIBUTES[attribute])
commands.append("-" + lasgrid.ATTRIBUTES[attribute])
method = self.getParameterValue(lasgrid.METHOD)
if method != 0:
commands.append('-' + lasgrid.METHODS[method])
commands.append("-" + lasgrid.METHODS[method])
self.addParametersRasterOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -24,9 +24,7 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -36,41 +34,36 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterSelection import ParameterSelection
class lasground(LAStoolsAlgorithm):
AIRBORNE = 'AIRBORNE'
TERRAIN = 'TERRAIN'
TERRAINS = ['wilderness', 'nature', 'town', 'city', 'metro']
GRANULARITY = 'GRANULARITY'
GRANULARITIES = ['coarse', 'default', 'fine', 'extra_fine', 'ultra_fine']
AIRBORNE = "AIRBORNE"
TERRAIN = "TERRAIN"
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
GRANULARITY = "GRANULARITY"
GRANULARITIES = ["coarse", "default", "fine", "extra_fine", "ultra_fine"]
def defineCharacteristics(self):
self.name = 'lasground'
self.group = 'LAStools'
self.name = "lasground"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersHorizontalAndVerticalFeetGUI()
self.addParameter(ParameterBoolean(lasground.AIRBORNE, 'airborne LiDAR'
, True))
self.addParameter(ParameterSelection(lasground.TERRAIN, 'terrain type'
, lasground.TERRAINS, 1))
self.addParameter(ParameterSelection(lasground.GRANULARITY,
'preprocessing', lasground.GRANULARITIES, 1))
self.addParameter(ParameterBoolean(lasground.AIRBORNE, "airborne LiDAR", True))
self.addParameter(ParameterSelection(lasground.TERRAIN, "terrain type", lasground.TERRAINS, 1))
self.addParameter(ParameterSelection(lasground.GRANULARITY, "preprocessing", lasground.GRANULARITIES, 1))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasground.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersHorizontalAndVerticalFeetCommands(commands)
self.addParametersHorizontalAndVerticalFeetCommands(commands)
method = self.getParameterValue(lasground.TERRAIN)
if method != 1:
commands.append('-' + lasground.TERRAINS[method])
commands.append("-" + lasground.TERRAINS[method])
granularity = self.getParameterValue(lasground.GRANULARITY)
if granularity != 1:
commands.append('-' + lasground.GRANULARITIES[granularity])
commands.append("-" + lasground.GRANULARITIES[granularity])
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
lasgroundPro.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : April 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__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterSelection import ParameterSelection
class lasgroundPro(LAStoolsAlgorithm):
AIRBORNE = "AIRBORNE"
TERRAIN = "TERRAIN"
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
GRANULARITY = "GRANULARITY"
GRANULARITIES = ["coarse", "default", "fine", "extra_fine", "ultra_fine"]
def defineCharacteristics(self):
self.name = "lasgroundPro"
self.group = "LAStools Production"
self.addParametersPointInputFolderGUI()
self.addParametersHorizontalAndVerticalFeetGUI()
self.addParameter(ParameterBoolean(lasgroundPro.AIRBORNE, "airborne LiDAR", True))
self.addParameter(ParameterSelection(lasgroundPro.TERRAIN, "terrain type", lasgroundPro.TERRAINS, 1))
self.addParameter(ParameterSelection(lasgroundPro.GRANULARITY, "preprocessing", lasgroundPro.GRANULARITIES, 1))
self.addParametersOutputDirectoryGUI()
self.addParametersOutputAppendixGUI()
self.addParametersPointOutputFormatGUI()
self.addParametersAdditionalGUI()
self.addParametersCoresGUI()
self.addParametersVerboseGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
self.addParametersHorizontalAndVerticalFeetCommands(commands)
airborne = self.getParameterValue(lasgroundPro.AIRBORNE)
if airborne != True:
commands.append("-not_airborne")
method = self.getParameterValue(lasgroundPro.TERRAIN)
if method != 1:
commands.append("-" + lasgroundPro.TERRAINS[method])
granularity = self.getParameterValue(lasgroundPro.GRANULARITY)
if granularity != 1:
commands.append("-" + lasgroundPro.GRANULARITIES[granularity])
self.addParametersCoresCommands(commands)
self.addParametersOutputDirectoryCommands(commands)
self.addParametersOutputAppendixCommands(commands)
self.addParametersPointOutputFormatCommands(commands)
self.addParametersAdditionalCommands(commands)
self.addParametersCoresCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -31,28 +29,26 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterBoolean import ParameterBoolean
class lasheight(LAStoolsAlgorithm):
REPLACE_Z = 'REPLACE_Z'
REPLACE_Z = "REPLACE_Z"
def defineCharacteristics(self):
self.name = 'lasheight'
self.group = 'LAStools'
self.name = "lasheight"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterBoolean(lasheight.REPLACE_Z, 'replace z',
False))
self.addParameter(ParameterBoolean(lasheight.REPLACE_Z, "replace z", False))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasheight.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
replace_z = self.getParameterValue(lasheight.REPLACE_Z)
if replace_z:
commands.append('-replace_z')
if replace_z == True:
commands.append("-replace_z")
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -31,29 +29,26 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterBoolean import ParameterBoolean
class lasindex(LAStoolsAlgorithm):
MOBILE_OR_TERRESTRIAL = 'MOBILE_OR_TERRESTRIAL'
MOBILE_OR_TERRESTRIAL = "MOBILE_OR_TERRESTRIAL"
def defineCharacteristics(self):
self.name = 'lasindex'
self.group = 'LAStools'
self.name = "lasindex"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterBoolean(lasindex.MOBILE_OR_TERRESTRIAL,
'is mobile or terrestrial LiDAR (not airborne)',
False))
self.addParameter(ParameterBoolean(lasindex.MOBILE_OR_TERRESTRIAL, "is mobile or terrestrial LiDAR (not airborne)", False))
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasindex.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasindex.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
if self.getParameterValue(lasindex.MOBILE_OR_TERRESTRIAL):
commands.append('-tile_size')
commands.append('10')
commands.append('-maximum')
commands.append('-100')
commands.append("-tile_size")
commands.append("10")
commands.append("-maximum")
commands.append("-100")
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -24,35 +24,30 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# 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.parameters.ParameterFile import ParameterFile
from processing.outputs.OutputFile import OutputFile
class lasinfo(LAStoolsAlgorithm):
OUTPUT = 'OUTPUT'
OUTPUT = "OUTPUT"
def defineCharacteristics(self):
self.name = 'lasinfo'
self.group = 'LAStools'
self.name = "lasinfo"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addOutput(OutputFile(lasinfo.OUTPUT, 'Output ASCII file'))
self.addOutput(OutputFile(lasinfo.OUTPUT, "Output ASCII file"))
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasinfo.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasinfo.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
commands.append('-o')
commands.append("-o")
commands.append(self.getOutputValue(lasinfo.OUTPUT))
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -31,60 +29,59 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterFile import ParameterFile
class lasmerge(LAStoolsAlgorithm):
FILE2 = 'FILE2'
FILE3 = 'FILE3'
FILE4 = 'FILE4'
FILE5 = 'FILE5'
FILE6 = 'FILE6'
FILE7 = 'FILE7'
FILE2 = "FILE2"
FILE3 = "FILE3"
FILE4 = "FILE4"
FILE5 = "FILE5"
FILE6 = "FILE6"
FILE7 = "FILE7"
def defineCharacteristics(self):
self.name = 'lasmerge'
self.group = 'LAStools'
self.name = "lasmerge"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersFilesAreFlightlinesGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterFile(lasmerge.FILE2, '2nd file'))
self.addParameter(ParameterFile(lasmerge.FILE3, '3rd file'))
self.addParameter(ParameterFile(lasmerge.FILE4, '4th file'))
self.addParameter(ParameterFile(lasmerge.FILE5, '5th file'))
self.addParameter(ParameterFile(lasmerge.FILE6, '6th file'))
self.addParameter(ParameterFile(lasmerge.FILE7, '7th file'))
self.addParameter(ParameterFile(lasmerge.FILE2, "2nd file"))
self.addParameter(ParameterFile(lasmerge.FILE3, "3rd file"))
self.addParameter(ParameterFile(lasmerge.FILE4, "4th file"))
self.addParameter(ParameterFile(lasmerge.FILE5, "5th file"))
self.addParameter(ParameterFile(lasmerge.FILE6, "6th file"))
self.addParameter(ParameterFile(lasmerge.FILE7, "7th file"))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasmerge.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasmerge.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersFilesAreFlightlinesCommands(commands)
self.addParametersPointInputCommands(commands)
file2 = self.getParameterValue(lasmerge.FILE2)
if file2 is not None:
commands.append('-i')
if file2 != None:
commands.append("-i")
commands.append(file2)
file3 = self.getParameterValue(lasmerge.FILE3)
if file3 is not None:
commands.append('-i')
if file3 != None:
commands.append("-i")
commands.append(file3)
file4 = self.getParameterValue(lasmerge.FILE4)
if file4 is not None:
commands.append('-i')
if file4 != None:
commands.append("-i")
commands.append(file4)
file5 = self.getParameterValue(lasmerge.FILE5)
if file5 is not None:
commands.append('-i')
if file5 != None:
commands.append("-i")
commands.append(file5)
file6 = self.getParameterValue(lasmerge.FILE6)
if file6 is not None:
commands.append('-i')
if file6 != None:
commands.append("-i")
commands.append(file6)
file7 = self.getParameterValue(lasmerge.FILE7)
if file7 is not None:
commands.append('-i')
if file7 != None:
commands.append("-i")
commands.append(file7)
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -32,54 +30,46 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterSelection import ParameterSelection
class lasnoise(LAStoolsAlgorithm):
ISOLATED = 'ISOLATED'
STEP_XY = 'STEP_XY'
STEP_Z = 'STEP_Z'
OPERATION = 'OPERATION'
OPERATIONS = ['classify', 'remove']
CLASSIFY_AS = 'CLASSIFY_AS'
ISOLATED = "ISOLATED"
STEP_XY = "STEP_XY"
STEP_Z = "STEP_Z"
OPERATION = "OPERATION"
OPERATIONS = ["classify", "remove"]
CLASSIFY_AS = "CLASSIFY_AS"
def defineCharacteristics(self):
self.name = 'lasnoise'
self.group = 'LAStools'
self.name = "lasnoise"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterNumber(lasnoise.ISOLATED,
'isolated if surrounding cells have only', 0, None,
5))
self.addParameter(ParameterNumber(lasnoise.STEP_XY,
'resolution of isolation grid in xy', 0, None, 4.0))
self.addParameter(ParameterNumber(lasnoise.STEP_Z,
'resolution of isolation grid in z ', 0, None, 4.0))
self.addParameter(ParameterSelection(lasnoise.OPERATION,
'what to do with isolated points',
lasnoise.OPERATIONS, 0))
self.addParameter(ParameterNumber(lasnoise.CLASSIFY_AS, 'classify as',
0, None, 7))
self.addParameter(ParameterNumber(lasnoise.ISOLATED, "isolated if surrounding cells have only", 0, None, 5))
self.addParameter(ParameterNumber(lasnoise.STEP_XY, "resolution of isolation grid in xy", 0, None, 4.0))
self.addParameter(ParameterNumber(lasnoise.STEP_Z, "resolution of isolation grid in z ", 0, None, 4.0))
self.addParameter(ParameterSelection(lasnoise.OPERATION, "what to do with isolated points", lasnoise.OPERATIONS, 0))
self.addParameter(ParameterNumber(lasnoise.CLASSIFY_AS, "classify as", 0, None, 7))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasnoise.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasnoise.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
isolated = self.getParameterValue(lasnoise.ISOLATED)
commands.append('-isolated')
commands.append("-isolated")
commands.append(str(isolated))
step_xy = self.getParameterValue(lasnoise.STEP_XY)
commands.append('-step_xy')
commands.append("-step_xy")
commands.append(str(step_xy))
step_z = self.getParameterValue(lasnoise.STEP_Z)
commands.append('-step_z')
commands.append("-step_z")
commands.append(str(step_z))
operation = self.getParameterValue(lasnoise.OPERATION)
if operation != 0:
commands.append('-remove_noise')
commands.append("-remove_noise")
else:
commands.append('-classify_as')
commands.append("-classify_as")
classify_as = self.getParameterValue(lasnoise.CLASSIFY_AS)
commands.append(str(classify_as))
self.addParametersPointOutputCommands(commands)

View File

@ -20,57 +20,49 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterSelection import ParameterSelection
class lasoverage(LAStoolsAlgorithm):
CHECK_STEP = 'CHECK_STEP'
OPERATION = 'OPERATION'
OPERATIONS = ['classify as overlap', 'flag as withheld',
'remove from output']
CHECK_STEP = "CHECK_STEP"
OPERATION = "OPERATION"
OPERATIONS= ["classify as overlap", "flag as withheld", "remove from output"]
def defineCharacteristics(self):
self.name = 'lasoverage'
self.group = 'LAStools'
self.name = "lasoverage"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersHorizontalFeetGUI()
self.addParametersFilesAreFlightlinesGUI()
self.addParameter(ParameterNumber(lasoverage.CHECK_STEP,
'size of grid used for scan angle check', 0, None,
1.0))
self.addParameter(ParameterSelection(lasoverage.OPERATION,
'mode of operation', lasoverage.OPERATIONS, 0))
self.addParameter(ParameterNumber(lasoverage.CHECK_STEP, "size of grid used for scan angle check", 0, None, 1.0))
self.addParameter(ParameterSelection(lasoverage.OPERATION, "mode of operation", lasoverage.OPERATIONS, 0))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasoverage.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasoverage.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersHorizontalFeetCommands(commands)
self.addParametersFilesAreFlightlinesCommands(commands)
step = self.getParameterValue(lasoverage.CHECK_STEP)
if step != 1.0:
commands.append('-step')
commands.append("-step")
commands.append(str(step))
operation = self.getParameterValue(lasoverage.OPERATION)
if operation != 0:
commands.append('-' + OPERATIONS[operation])
if self.getParameterValue(lasoverage.WITHHELD):
commands.append('-withheld')
if operation == 1:
commands.append("-flag_as_withheld")
elif operation == 2:
commands.append("-remove_overage")
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,73 +20,60 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from LAStoolsUtils import LAStoolsUtils
from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterSelection import ParameterSelection
class lasoverlap(LAStoolsAlgorithm):
CHECK_STEP = 'CHECK_STEP'
ATTRIBUTE = 'ATTRIBUTE'
OPERATION = 'OPERATION'
ATTRIBUTES = ['elevation', 'intensity', 'number_of_returns',
'scan_angle_abs', 'density']
OPERATIONS = ['lowest', 'highest', 'average']
CREATE_OVERLAP_RASTER = 'CREATE_OVERLAP_RASTER'
CREATE_DIFFERENCE_RASTER = 'CREATE_DIFFERENCE_RASTER'
CHECK_STEP = "CHECK_STEP"
ATTRIBUTE = "ATTRIBUTE"
OPERATION = "OPERATION"
ATTRIBUTES = ["elevation", "intensity", "number_of_returns", "scan_angle_abs", "density"]
OPERATIONS = ["lowest", "highest", "average"]
CREATE_OVERLAP_RASTER = "CREATE_OVERLAP_RASTER"
CREATE_DIFFERENCE_RASTER = "CREATE_DIFFERENCE_RASTER"
def defineCharacteristics(self):
self.name = 'lasoverlap'
self.group = 'LAStools'
self.name = "lasoverlap"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersFilter1ReturnClassFlagsGUI()
self.addParameter(ParameterNumber(lasoverlap.CHECK_STEP,
'size of grid used for overlap check', 0, None, 2.0))
self.addParameter(ParameterSelection(lasoverlap.ATTRIBUTE,
'attribute to check', lasoverlap.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(lasoverlap.OPERATION,
'operation on attribute per cell',
lasoverlap.OPERATIONS, 0))
self.addParameter(ParameterBoolean(lasoverlap.CREATE_OVERLAP_RASTER,
'create overlap raster', True))
self.addParameter(ParameterBoolean(lasoverlap.CREATE_DIFFERENCE_RASTER,
'create difference raster', True))
self.addParameter(ParameterNumber(lasoverlap.CHECK_STEP, "size of grid used for overlap check", 0, None, 2.0))
self.addParameter(ParameterSelection(lasoverlap.ATTRIBUTE, "attribute to check", lasoverlap.ATTRIBUTES, 0))
self.addParameter(ParameterSelection(lasoverlap.OPERATION, "operation on attribute per cell", lasoverlap.OPERATIONS, 0))
self.addParameter(ParameterBoolean(lasoverlap.CREATE_OVERLAP_RASTER, "create overlap raster", True))
self.addParameter(ParameterBoolean(lasoverlap.CREATE_DIFFERENCE_RASTER, "create difference raster", True))
self.addParametersRasterOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasoverlap.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasoverlap.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
step = self.getParameterValue(lasoverlap.CHECK_STEP)
if step != 0.0:
commands.append('-step')
commands.append("-step")
commands.append(str(step))
commands.append('-values')
commands.append("-values")
attribute = self.getParameterValue(lasoverlap.ATTRIBUTE)
if attribute != 0:
commands.append('-' + lasoverlap.ATTRIBUTES[attribute])
commands.append("-" + lasoverlap.ATTRIBUTES[attribute])
operation = self.getParameterValue(lasoverlap.OPERATION)
if operation != 0:
commands.append('-' + lasoverlap.OPERATIONS[operation])
if self.getParameterValue(lasoverlap.CREATE_OVERLAP_RASTER):
commands.append('-no_over')
if self.getParameterValue(lasoverlap.CREATE_DIFFERENCE_RASTER):
commands.append('-no_diff')
commands.append("-" + lasoverlap.OPERATIONS[operation])
if self.getParameterValue(lasoverlap.CREATE_OVERLAP_RASTER) != True:
commands.append("-no_over")
if self.getParameterValue(lasoverlap.CREATE_DIFFERENCE_RASTER) != True:
commands.append("-no_diff")
self.addParametersRasterOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -24,36 +24,31 @@
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from LAStoolsUtils import LAStoolsUtils
from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.outputs.OutputFile import OutputFile
class lasprecision(LAStoolsAlgorithm):
OUTPUT = 'OUTPUT'
OUTPUT = "OUTPUT"
def defineCharacteristics(self):
self.name = 'lasprecision'
self.group = 'LAStools'
self.name = "lasprecision"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addOutput(OutputFile(lasprecision.OUTPUT, 'Output ASCII file'))
self.addOutput(OutputFile(lasprecision.OUTPUT, "Output ASCII file"))
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasprecision.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasprecision.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
commands.append('-o')
commands.append("-o")
commands.append(self.getOutputValue(lasprecision.OUTPUT))
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,74 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
lasinfo.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : March 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__ = 'March 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 processing.parameters.ParameterExtent import ParameterExtent
from LAStoolsAlgorithm import LAStoolsAlgorithm
from qgis.core import QgsMapLayer, QgsMapLayerRegistry, QgsVectorLayer
class lasquery(LAStoolsAlgorithm):
AOI = "AOI"
def defineCharacteristics(self):
self.name = "lasquery"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParameter(ParameterExtent(self.AOI, 'area of interest'))
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasview.exe")]
self.addParametersVerboseCommands(commands)
# get area-of-interest
aoi = str(self.getParameterValue(self.AOI))
aoiCoords = aoi.split(',')
# get layers
layers = QgsMapLayerRegistry.instance().mapLayers()
# loop over layers
for name,layer in layers.iteritems():
layerType = layer.type()
if layerType == QgsMapLayer.VectorLayer:
shp_file_name = layer.source()
file_name = shp_file_name[:-4] + ".laz"
commands.append('-i')
commands.append(file_name)
commands.append("-files_are_flightlines")
commands.append('-inside')
commands.append(aoiCoords[0])
commands.append(aoiCoords[2])
commands.append(aoiCoords[1])
commands.append(aoiCoords[3])
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -31,32 +29,29 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterBoolean import ParameterBoolean
class lassort(LAStoolsAlgorithm):
BY_GPS_TIME = 'BY_GPS_TIME'
BY_POINT_SOURCE_ID = 'BY_POINT_SOURCE_ID'
BY_GPS_TIME = "BY_GPS_TIME"
BY_POINT_SOURCE_ID = "BY_POINT_SOURCE_ID"
def defineCharacteristics(self):
self.name = 'lassort'
self.group = 'LAStools'
self.name = "lassort"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterBoolean(lassort.BY_GPS_TIME,
'sort by GPS time', False))
self.addParameter(ParameterBoolean(lassort.BY_POINT_SOURCE_ID,
'sort by point source ID', False))
self.addParameter(ParameterBoolean(lassort.BY_GPS_TIME, "sort by GPS time", False))
self.addParameter(ParameterBoolean(lassort.BY_POINT_SOURCE_ID, "sort by point source ID", False))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lassort.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lassort.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
if self.getParameterValue(lassort.BY_GPS_TIME):
commands.append('-gps_time')
commands.append("-gps_time")
if self.getParameterValue(lassort.BY_POINT_SOURCE_ID):
commands.append('-point_source')
commands.append("-point_source")
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -4,12 +4,8 @@
***************************************************************************
lassplit.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
Date : September 2013
Copyright : (C) 2013 by Martin Isenburg
Date : March 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***************************************************************************
* *
@ -21,12 +17,10 @@
***************************************************************************
"""
__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
__author__ = 'Martin Isenburg'
__date__ = 'March 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
@ -34,29 +28,42 @@ from LAStoolsUtils import LAStoolsUtils
from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterSelection import ParameterSelection
class lassplit(LAStoolsAlgorithm):
NUM_POINTS = 'NUM_POINTS'
DIGITS = "DIGITS"
OPERATION = "OPERATION"
OPERATIONS = ["by_flightline", "by_classification", "by_gps_time_interval", "by_intensity_interval", "by_x_interval", "by_y_interval", "by_z_interval", "by_scan_angle_interval", "by_user_data_interval", "every_x_points", "recover_flightlines"]
INTERVAL = "INTERVAL"
def defineCharacteristics(self):
self.name = 'lassplit'
self.group = 'LAStools'
self.name = "lassplit"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterNumber(lassplit.NUM_POINTS,
'number of points in output files', 1, None,
1000000))
self.addParameter(ParameterNumber(lassplit.DIGITS, "number of digits for file names", 0, None, 5))
self.addParameter(ParameterSelection(lassplit.OPERATION, "how to split", lassplit.OPERATIONS, 0))
self.addParameter(ParameterNumber(lassplit.INTERVAL, "interval or number", 0, None, 5))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lassplit.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lassplit.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
commands.append('-split')
commands.append(self.getParameterValue(lassplit.NUM_POINTS))
digits = self.getParameterValue(lassplit.DIGITS)
if digits != 5:
commands.append("-digits")
commands.append(str(digits))
operation = self.getParameterValue(lassplit.OPERATION)
if operation != 0:
if operation == 9:
commands.append("-split")
else:
commands.append("-" + lassplit.OPERATIONS[operation])
if operation > 1 and operation < 10:
interval = self.getParameterValue(lassplit.INTERVAL)
commands.append(str(interval))
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -33,42 +31,37 @@ from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterSelection import ParameterSelection
class lasthin(LAStoolsAlgorithm):
THIN_STEP = 'THIN_STEP'
OPERATION = 'OPERATION'
OPERATIONS = ['lowest', 'random', 'highest']
WITHHELD = 'WITHHELD'
THIN_STEP = "THIN_STEP"
OPERATION = "OPERATION"
OPERATIONS= ["lowest", "random", "highest"]
WITHHELD = "WITHHELD"
def defineCharacteristics(self):
self.name = 'lasthin'
self.group = 'LAStools'
self.name = "lasthin"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterNumber(lasthin.THIN_STEP,
'size of grid used for thinning', 0, None, 1.0))
self.addParameter(ParameterSelection(lasthin.OPERATION,
'keep particular point per cell',
lasthin.OPERATIONS, 0))
self.addParameter(ParameterBoolean(lasthin.WITHHELD,
'mark points as withheld', False))
self.addParameter(ParameterNumber(lasthin.THIN_STEP, "size of grid used for thinning", 0, None, 1.0))
self.addParameter(ParameterSelection(lasthin.OPERATION, "keep particular point per cell", lasthin.OPERATIONS, 0))
self.addParameter(ParameterBoolean(lasthin.WITHHELD, "mark points as withheld", False))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasthin.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
step = self.getParameterValue(lasthin.THIN_STEP)
if step != 0.0:
commands.append('-step')
commands.append("-step")
commands.append(str(step))
operation = self.getParameterValue(lasthin.OPERATION)
if operation != 0:
commands.append('-' + OPERATIONS[operation])
commands.append("-" + self.OPERATIONS[operation])
if self.getParameterValue(lasthin.WITHHELD):
commands.append('-withheld')
commands.append("-withheld")
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,55 +20,46 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
class lastile(LAStoolsAlgorithm):
TILE_SIZE = 'TILE_SIZE'
BUFFER = 'BUFFER'
REVERSIBLE = 'REVERSIBLE'
TILE_SIZE = "TILE_SIZE"
BUFFER = "BUFFER"
REVERSIBLE = "REVERSIBLE"
def defineCharacteristics(self):
self.name = 'lastile'
self.group = 'LAStools'
self.name = "lastile"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParametersFilesAreFlightlinesGUI()
self.addParameter(ParameterNumber(lastile.TILE_SIZE,
'tile size (side length of square tile)', None,
None, 1000.0))
self.addParameter(ParameterNumber(lastile.BUFFER,
'buffer around each tile', None, None, 0.0))
self.addParameter(ParameterNumber(lastile.BUFFER,
'make tiling reversible (advanced)', False))
self.addParameter(ParameterNumber(lastile.TILE_SIZE, "tile size (side length of square tile)", None, None, 1000.0))
self.addParameter(ParameterNumber(lastile.BUFFER, "buffer around each tile", None, None, 0.0))
self.addParameter(ParameterNumber(lastile.BUFFER, "make tiling reversible (advanced)", False))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lastile.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilesAreFlightlinesCommands(commands)
tile_size = self.getParameterValue(lastile.TILE_SIZE)
commands.append('-tile_size')
commands.append("-tile_size")
commands.append(str(tile_size))
buffer = self.getParameterValue(lastile.BUFFER)
if buffer != 0.0:
commands.append('-buffer')
commands.append("-buffer")
commands.append(str(buffer))
if self.getParameterValue(lastile.REVERSIBLE):
commands.append('-reversible')
commands.append("-reversible")
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -0,0 +1,77 @@
# -*- coding: utf-8 -*-
"""
***************************************************************************
lastilePro.py
---------------------
Date : April 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__ = 'April 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
class lastilePro(LAStoolsAlgorithm):
TILE_SIZE = "TILE_SIZE"
BUFFER = "BUFFER"
EXTRA_PASS = "EXTRA_PASS"
BASE_NAME = "BASE_NAME"
def defineCharacteristics(self):
self.name = "lastilePro"
self.group = "LAStools Production"
self.addParametersPointInputFolderGUI()
self.addParametersFilesAreFlightlinesGUI()
self.addParameter(ParameterNumber(lastilePro.TILE_SIZE, "tile size (side length of square tile)", None, None, 1000.0))
self.addParameter(ParameterNumber(lastilePro.BUFFER, "buffer around each tile (avoids edge artifacts)", None, None, 25.0))
self.addParameter(ParameterBoolean(lastilePro.EXTRA_PASS, "more than 2000 tiles", False))
self.addParametersOutputDirectoryGUI()
self.addParameter(ParameterString(lastilePro.BASE_NAME, "tile base name (using sydney.laz creates sydney_274000_4714000.laz)"))
self.addParametersPointOutputFormatGUI()
self.addParametersAdditionalGUI()
self.addParametersVerboseGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputFolderCommands(commands)
self.addParametersFilesAreFlightlinesCommands(commands)
tile_size = self.getParameterValue(lastilePro.TILE_SIZE)
commands.append("-tile_size")
commands.append(str(tile_size))
buffer = self.getParameterValue(lastilePro.BUFFER)
if buffer != 0.0:
commands.append("-buffer")
commands.append(str(buffer))
if self.getParameterValue(lastilePro.EXTRA_PASS):
commands.append("-extra_pass")
self.addParametersOutputDirectoryCommands(commands)
base_name = self.getParameterValue(lastilePro.BASE_NAME)
if base_name != None:
commands.append("-o")
commands.append(base_name)
self.addParametersPointOutputFormatCommands(commands)
self.addParametersAdditionalCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -30,24 +28,22 @@ from LAStoolsUtils import LAStoolsUtils
from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.outputs.OutputFile import OutputFile
class lasvalidate(LAStoolsAlgorithm):
OUTPUT = 'OUTPUT'
OUTPUT = "OUTPUT"
def defineCharacteristics(self):
self.name = 'lasvalidate'
self.group = 'LAStools'
self.name = "lasvalidate"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addOutput(OutputFile(lasvalidate.OUTPUT, 'Output XML file'))
self.addOutput(OutputFile(lasvalidate.OUTPUT, "Output XML file"))
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasvalidate.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasvalidate.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
commands.append('-o')
commands.append("-o")
commands.append(self.getOutputValue(lasvalidate.OUTPUT))
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -24,30 +24,26 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, 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
class lasview(LAStoolsAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
INPUT = "INPUT"
OUTPUT = "OUTPUT"
def defineCharacteristics(self):
self.name = 'lasview'
self.group = 'LAStools'
self.name = "lasview"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'lasview.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasview.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)

View File

@ -20,9 +20,7 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, Martin Isenburg'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
@ -31,27 +29,25 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
from processing.parameters.ParameterBoolean import ParameterBoolean
class laszip(LAStoolsAlgorithm):
REPORT_SIZE = 'REPORT_SIZE'
REPORT_SIZE = "REPORT_SIZE"
def defineCharacteristics(self):
self.name = 'laszip'
self.group = 'LAStools'
self.name = "laszip"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParametersPointInputGUI()
self.addParameter(ParameterBoolean(laszip.REPORT_SIZE,
'only report size', False))
self.addParameter(ParameterBoolean(laszip.REPORT_SIZE, "only report size", False))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'laszip.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "laszip.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
if self.getParameterValue(laszip.REPORT_SIZE):
commands.append('-size')
commands.append("-size")
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,51 +20,41 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterFile import ParameterFile
class shp2las(LAStoolsAlgorithm):
INPUT = 'INPUT'
SCALE_FACTOR_XY = 'SCALE_FACTOR_XY'
SCALE_FACTOR_Z = 'SCALE_FACTOR_Z'
INPUT = "INPUT"
SCALE_FACTOR_XY = "SCALE_FACTOR_XY"
SCALE_FACTOR_Z = "SCALE_FACTOR_Z"
def defineCharacteristics(self):
self.name = 'shp2las'
self.group = 'LAStools'
self.name = "shp2las"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParameter(ParameterFile(shp2las.INPUT, 'Input SHP file'))
self.addParameter(ParameterNumber(shp2las.SCALE_FACTOR_XY,
'resolution of x and y coordinate', False, False,
0.01))
self.addParameter(ParameterNumber(shp2las.SCALE_FACTOR_Z,
'resolution of z coordinate', False, False, 0.01))
self.addParameter(ParameterFile(shp2las.INPUT, "Input SHP file"))
self.addParameter(ParameterNumber(shp2las.SCALE_FACTOR_XY, "resolution of x and y coordinate", False, False, 0.01))
self.addParameter(ParameterNumber(shp2las.SCALE_FACTOR_Z, "resolution of z coordinate", False, False, 0.01))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'shp2las.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "shp2las.exe")]
self.addParametersVerboseCommands(commands)
commands.append('-i')
commands.append("-i")
commands.append(self.getParameterValue(shp2las.INPUT))
scale_factor_xy = self.getParameterValue(shp2las.SCALE_FACTOR_XY)
scale_factor_z = self.getParameterValue(shp2las.SCALE_FACTOR_Z)
if scale_factor_xy != 0.01 or scale_factor_z != 0.01:
commands.append('-set_scale_factor')
commands.append(str(scale_factor_xy) + ' ' + str(scale_factor_xy)
+ ' ' + str(scale_factor_z))
commands.append("-set_scale_factor")
commands.append(str(scale_factor_xy) + " " + str(scale_factor_xy) + " " + str(scale_factor_z))
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)

View File

@ -20,65 +20,54 @@
__author__ = 'Martin Isenburg'
__date__ = 'September 2013'
__copyright__ = '(C) 2013, 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.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterFile import ParameterFile
class txt2las(LAStoolsAlgorithm):
INPUT = 'INPUT'
PARSE_STRING = 'PARSE_STRING'
SKIP = 'SKIP'
SCALE_FACTOR_XY = 'SCALE_FACTOR_XY'
SCALE_FACTOR_Z = 'SCALE_FACTOR_Z'
INPUT = "INPUT"
PARSE_STRING = "PARSE_STRING"
SKIP = "SKIP"
SCALE_FACTOR_XY = "SCALE_FACTOR_XY"
SCALE_FACTOR_Z = "SCALE_FACTOR_Z"
def defineCharacteristics(self):
self.name = 'txt2las'
self.group = 'LAStools'
self.name = "txt2las"
self.group = "LAStools"
self.addParametersVerboseGUI()
self.addParameter(ParameterFile(txt2las.INPUT, 'Input ASCII file'))
self.addParameter(ParameterString(txt2las.PARSE_STRING,
'parse lines as', 'xyz'))
self.addParameter(ParameterNumber(txt2las.SKIP,
'skip the first n lines', False, False, 0))
self.addParameter(ParameterNumber(txt2las.SCALE_FACTOR_XY,
'resolution of x and y coordinate', False, False,
0.01))
self.addParameter(ParameterNumber(txt2las.SCALE_FACTOR_Z,
'resolution of z coordinate', False, False, 0.01))
self.addParameter(ParameterFile(txt2las.INPUT, "Input ASCII file"))
self.addParameter(ParameterString(txt2las.PARSE_STRING, "parse lines as", "xyz"))
self.addParameter(ParameterNumber(txt2las.SKIP, "skip the first n lines", False, False, 0))
self.addParameter(ParameterNumber(txt2las.SCALE_FACTOR_XY, "resolution of x and y coordinate", False, False, 0.01))
self.addParameter(ParameterNumber(txt2las.SCALE_FACTOR_Z, "resolution of z coordinate", False, False, 0.01))
self.addParametersPointOutputGUI()
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
'txt2las.exe')]
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "txt2las.exe")]
self.addParametersVerboseCommands(commands)
commands.append('-i')
commands.append("-i")
commands.append(self.getParameterValue(txt2las.INPUT))
parse_string = self.getParameterValue(txt2las.PARSE_STRING)
if parse_string != 'xyz':
commands.append('-parse_string')
if parse_string != "xyz":
commands.append("-parse_string")
commands.append(parse_string)
skip = self.getParameterValue(txt2las.SKIP)
if parse_string != 0:
commands.append('-skip')
commands.append("-skip")
commands.append(str(skip))
scale_factor_xy = self.getParameterValue(txt2las.SCALE_FACTOR_XY)
scale_factor_z = self.getParameterValue(txt2las.SCALE_FACTOR_Z)
if scale_factor_xy != 0.01 or scale_factor_z != 0.01:
commands.append('-set_scale_factor')
commands.append(str(scale_factor_xy) + ' ' + str(scale_factor_xy)
+ ' ' + str(scale_factor_z))
commands.append("-set_scale_factor")
commands.append(str(scale_factor_xy) + " " + str(scale_factor_xy) + " " + str(scale_factor_z))
self.addParametersPointOutputCommands(commands)
LAStoolsUtils.runLAStools(commands, progress)