mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[processing] update of lidar algorithms
Provided by Martin Isenburg
This commit is contained in:
parent
9e879ed9ee
commit
6c7d61f3be
@ -8,7 +8,7 @@
|
||||
Copyright : (C) 2012 by Victor Olaya
|
||||
Email : volayaf at gmail dot com
|
||||
---------------------
|
||||
Date : April 2014
|
||||
Date : April, October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
---------------------
|
||||
@ -81,6 +81,30 @@ from lastools.lasoverlap import lasoverlap
|
||||
from lastools.lastilePro import lastilePro
|
||||
from lastools.lasgroundPro import lasgroundPro
|
||||
from lastools.las2demPro import las2demPro
|
||||
from lastools.lasheightPro import lasheightPro
|
||||
from lastools.laszipPro import laszipPro
|
||||
from lastools.lasgridPro import lasgridPro
|
||||
from lastools.lasduplicatePro import lasduplicatePro
|
||||
from lastools.lassortPro import lassortPro
|
||||
from lastools.lasclassifyPro import lasclassifyPro
|
||||
from lastools.lasthinPro import lasthinPro
|
||||
from lastools.lasnoisePro import lasnoisePro
|
||||
from lastools.lasindexPro import lasindexPro
|
||||
from lastools.lascanopyPro import lascanopyPro
|
||||
from lastools.blast2demPro import blast2demPro
|
||||
from lastools.lasboundaryPro import lasboundaryPro
|
||||
from lastools.lasinfoPro import lasinfoPro
|
||||
from lastools.las2lasPro_filter import las2lasPro_filter
|
||||
from lastools.las2lasPro_project import las2lasPro_project
|
||||
from lastools.las2lasPro_transform import las2lasPro_transform
|
||||
from lastools.lasoveragePro import lasoveragePro
|
||||
from lastools.txt2lasPro import txt2lasPro
|
||||
from lastools.las2txtPro import las2txtPro
|
||||
from lastools.blast2isoPro import blast2isoPro
|
||||
from lastools.lasvalidatePro import lasvalidatePro
|
||||
from lastools.lasmergePro import lasmergePro
|
||||
from lastools.lasviewPro import lasviewPro
|
||||
from lastools.lasoverlapPro import lasoverlapPro
|
||||
|
||||
from lastools.flightlinesToDTMandDSM import flightlinesToDTMandDSM
|
||||
from lastools.flightlinesToCHM import flightlinesToCHM
|
||||
@ -105,7 +129,6 @@ from fusion.MergeData import MergeData
|
||||
from fusion.FilterData import FilterData
|
||||
from fusion.FusionUtils import FusionUtils
|
||||
|
||||
|
||||
class LidarToolsAlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
def __init__(self):
|
||||
@ -115,7 +138,7 @@ class LidarToolsAlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
# LAStools for processing single files
|
||||
|
||||
if isWindows():
|
||||
if (isWindows() or LAStoolsUtils.hasWine()):
|
||||
lastools = [
|
||||
lasground(), lasheight(), lasclassify(), lasclip(), lastile(),
|
||||
lascolor(), lasgrid(), las2dem(), blast2dem(), las2iso(), blast2iso(),
|
||||
@ -138,12 +161,19 @@ class LidarToolsAlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
# LAStools Production for processing folders of files
|
||||
|
||||
if isWindows():
|
||||
if (isWindows() or LAStoolsUtils.hasWine()):
|
||||
lastoolsPro = [
|
||||
lastilePro(), lasgroundPro(), las2demPro()
|
||||
lastilePro(), lasgroundPro(), las2demPro(), lasheightPro(), laszipPro(),
|
||||
lasduplicatePro(), lasgridPro(), lassortPro(), lasclassifyPro(), lasthinPro(),
|
||||
lasnoisePro(), lasindexPro(), lascanopyPro(), blast2demPro(), lasboundaryPro(),
|
||||
lasinfoPro(), las2lasPro_filter(), las2lasPro_project(), las2lasPro_transform(),
|
||||
lasoveragePro(), txt2lasPro(), las2txtPro(), blast2isoPro(), lasvalidatePro(),
|
||||
lasmergePro(), lasviewPro(), lasoverlapPro()
|
||||
]
|
||||
else:
|
||||
lastoolsPro = [
|
||||
laszipPro(), lasindexPro(), lasinfoPro(), las2lasPro_filter(), las2lasPro_project(),
|
||||
las2lasPro_transform(), txt2lasPro(), las2txtPro(), lasvalidatePro(), lasmergePro()
|
||||
]
|
||||
for alg in lastoolsPro:
|
||||
alg.group = 'LAStools Production'
|
||||
@ -151,7 +181,7 @@ class LidarToolsAlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
# some examples for LAStools Pipelines
|
||||
|
||||
if isWindows():
|
||||
if (isWindows() or LAStoolsUtils.hasWine()):
|
||||
lastoolsPipe = [
|
||||
flightlinesToDTMandDSM(), flightlinesToCHM(), flightlinesToSingleCHMpitFree(), hugeFileClassify(),
|
||||
hugeFileGroundClassify(), hugeFileNormalize()
|
||||
|
@ -45,10 +45,12 @@ from processing.core.outputs import OutputVector
|
||||
class LAStoolsAlgorithm(GeoAlgorithm):
|
||||
|
||||
VERBOSE = "VERBOSE"
|
||||
GUI = "GUI"
|
||||
CORES = "CORES"
|
||||
INPUT_LASLAZ = "INPUT_LASLAZ"
|
||||
INPUT_DIRECTORY = "INPUT_DIRECTORY"
|
||||
INPUT_WILDCARDS = "INPUT_WILDCARDS"
|
||||
MERGED = "MERGED"
|
||||
OUTPUT_LASLAZ = "OUTPUT_LASLAZ"
|
||||
OUTPUT_DIRECTORY = "OUTPUT_DIRECTORY"
|
||||
OUTPUT_APPENDIX = "OUTPUT_APPENDIX"
|
||||
@ -65,21 +67,22 @@ class LAStoolsAlgorithm(GeoAlgorithm):
|
||||
HORIZONTAL_FEET = "HORIZONTAL_FEET"
|
||||
VERTICAL_FEET = "VERTICAL_FEET"
|
||||
FILES_ARE_FLIGHTLINES = "FILES_ARE_FLIGHTLINES"
|
||||
APPLY_FILE_SOURCE_ID = "APPLY_FILE_SOURCE_ID"
|
||||
STEP = "STEP"
|
||||
FILTER_RETURN_CLASS_FLAGS1 = "FILTER_RETURN_CLASS_FLAGS1"
|
||||
FILTER_RETURN_CLASS_FLAGS2 = "FILTER_RETURN_CLASS_FLAGS2"
|
||||
FILTER_RETURN_CLASS_FLAGS3 = "FILTER_RETURN_CLASS_FLAGS3"
|
||||
FILTERS_RETURN_CLASS_FLAGS = ["---", "keep_last", "keep_first", "keep_middle", "keep_single", "drop_single",
|
||||
"keep_double", "keep_class 2", "keep_class 2 8", "keep_class 8", "keep_class 6",
|
||||
"keep_class 9", "keep_class 3 4 5", "keep_class 2 6", "drop_class 7", "drop_withheld"]
|
||||
"keep_class 9", "keep_class 3 4 5", "keep_class 2 6", "drop_class 7", "drop_withheld", "drop_synthetic"]
|
||||
FILTER_COORDS_INTENSITY1 = "FILTER_COORDS_INTENSITY1"
|
||||
FILTER_COORDS_INTENSITY2 = "FILTER_COORDS_INTENSITY2"
|
||||
FILTER_COORDS_INTENSITY3 = "FILTER_COORDS_INTENSITY3"
|
||||
FILTER_COORDS_INTENSITY1_ARG = "FILTER_COORDS_INTENSITY1_ARG"
|
||||
FILTER_COORDS_INTENSITY2_ARG = "FILTER_COORDS_INTENSITY2_ARG"
|
||||
FILTER_COORDS_INTENSITY3_ARG = "FILTER_COORDS_INTENSITY3_ARG"
|
||||
FILTERS_COORDS_INTENSITY = ["---", "clip_x_above", "clip_x_below", "clip_y_above", "clip_y_below", "clip_z_above",
|
||||
"clip_z_below", "drop_intensity_above", "drop_intensity_below", "drop_gps_time_above",
|
||||
FILTERS_COORDS_INTENSITY = ["---", "drop_x_above", "drop_x_below", "drop_y_above", "drop_y_below", "drop_z_above",
|
||||
"drop_z_below", "drop_intensity_above", "drop_intensity_below", "drop_gps_time_above",
|
||||
"drop_gps_time_below", "drop_scan_angle_above", "drop_scan_angle_below", "keep_point_source",
|
||||
"drop_point_source", "drop_point_source_above", "drop_point_source_below", "keep_user_data",
|
||||
"drop_user_data", "drop_user_data_above", "drop_user_data_below", "keep_every_nth",
|
||||
@ -110,10 +113,13 @@ class LAStoolsAlgorithm(GeoAlgorithm):
|
||||
|
||||
def addParametersVerboseGUI(self):
|
||||
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.VERBOSE, "verbose", False))
|
||||
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.GUI, "open LAStools GUI", False))
|
||||
|
||||
def addParametersVerboseCommands(self, commands):
|
||||
if self.getParameterValue(LAStoolsAlgorithm.VERBOSE):
|
||||
commands.append("-v")
|
||||
if self.getParameterValue(LAStoolsAlgorithm.GUI):
|
||||
commands.append("-gui")
|
||||
|
||||
def addParametersCoresGUI(self):
|
||||
self.addParameter(ParameterNumber(LAStoolsAlgorithm.CORES, "number of cores", 1, 32, 4))
|
||||
@ -125,7 +131,7 @@ class LAStoolsAlgorithm(GeoAlgorithm):
|
||||
commands.append(str(cores))
|
||||
|
||||
def addParametersPointInputGUI(self):
|
||||
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_LASLAZ, "input LAS/LAZ file"))
|
||||
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_LASLAZ, "input LAS/LAZ file", False, False))
|
||||
|
||||
def addParametersPointInputCommands(self, commands):
|
||||
input = self.getParameterValue(LAStoolsAlgorithm.INPUT_LASLAZ)
|
||||
@ -134,7 +140,7 @@ class LAStoolsAlgorithm(GeoAlgorithm):
|
||||
commands.append(input)
|
||||
|
||||
def addParametersPointInputFolderGUI(self):
|
||||
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, "input directory", True))
|
||||
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, "input directory", True, False))
|
||||
self.addParameter(ParameterString(LAStoolsAlgorithm.INPUT_WILDCARDS, "input wildcard(s)", "*.laz"))
|
||||
|
||||
def addParametersPointInputFolderCommands(self, commands):
|
||||
@ -147,6 +153,27 @@ class LAStoolsAlgorithm(GeoAlgorithm):
|
||||
else:
|
||||
commands.append('"' + wildcard + '"')
|
||||
|
||||
def addParametersPointInputMergedGUI(self):
|
||||
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.MERGED, "merge all input files on-the-fly into one", False))
|
||||
|
||||
def addParametersPointInputMergedCommands(self, commands):
|
||||
if self.getParameterValue(LAStoolsAlgorithm.MERGED):
|
||||
commands.append("-merged")
|
||||
|
||||
def addParametersGenericInputFolderGUI(self, wildcard):
|
||||
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, "input directory", True, False))
|
||||
self.addParameter(ParameterString(LAStoolsAlgorithm.INPUT_WILDCARDS, "input wildcard(s)", wildcard))
|
||||
|
||||
def addParametersGenericInputFolderCommands(self, commands):
|
||||
input = self.getParameterValue(LAStoolsAlgorithm.INPUT_DIRECTORY)
|
||||
wildcards = self.getParameterValue(LAStoolsAlgorithm.INPUT_WILDCARDS).split()
|
||||
for wildcard in wildcards:
|
||||
commands.append("-i")
|
||||
if input != None:
|
||||
commands.append('"' + input + "\\" + wildcard + '"')
|
||||
else:
|
||||
commands.append('"' + wildcard + '"')
|
||||
|
||||
def addParametersHorizontalFeetGUI(self):
|
||||
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.HORIZONTAL_FEET, "horizontal feet", False))
|
||||
|
||||
@ -170,12 +197,19 @@ class LAStoolsAlgorithm(GeoAlgorithm):
|
||||
self.addParametersVerticalFeetCommands(commands)
|
||||
|
||||
def addParametersFilesAreFlightlinesGUI(self):
|
||||
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES, "files are flightlines", True))
|
||||
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES, "files are flightlines", False))
|
||||
|
||||
def addParametersFilesAreFlightlinesCommands(self, commands):
|
||||
if self.getParameterValue(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES):
|
||||
commands.append("-files_are_flightlines")
|
||||
|
||||
def addParametersApplyFileSourceIdGUI(self):
|
||||
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.APPLY_FILE_SOURCE_ID, "apply file source ID", False))
|
||||
|
||||
def addParametersApplyFileSourceIdCommands(self, commands):
|
||||
if self.getParameterValue(LAStoolsAlgorithm.APPLY_FILE_SOURCE_ID):
|
||||
commands.append("-apply_file_source_ID")
|
||||
|
||||
def addParametersStepGUI(self):
|
||||
self.addParameter(ParameterNumber(LAStoolsAlgorithm.STEP, "step size / pixel size", 0, None, 1.0))
|
||||
|
||||
@ -252,7 +286,7 @@ class LAStoolsAlgorithm(GeoAlgorithm):
|
||||
commands.append(odix)
|
||||
|
||||
def addParametersTemporaryDirectoryGUI(self):
|
||||
self.addParameter(ParameterFile(LAStoolsAlgorithm.TEMPORARY_DIRECTORY, "empty temporary directory", True))
|
||||
self.addParameter(ParameterFile(LAStoolsAlgorithm.TEMPORARY_DIRECTORY, "empty temporary directory", True, False))
|
||||
|
||||
def addParametersTemporaryDirectoryAsOutputDirectoryCommands(self, commands):
|
||||
odir = self.getParameterValue(LAStoolsAlgorithm.TEMPORARY_DIRECTORY)
|
||||
|
@ -7,6 +7,10 @@
|
||||
Date : August 2012
|
||||
Copyright : (C) 2012 by Victor Olaya
|
||||
Email : volayaf at gmail dot com
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -32,20 +36,30 @@ class LAStoolsUtils:
|
||||
LASTOOLS_FOLDER = "LASTOOLS_FOLDER"
|
||||
WINE_FOLDER = "WINE_FOLDER"
|
||||
|
||||
@staticmethod
|
||||
def hasWine():
|
||||
wine_folder = ProcessingConfig.getSetting(LAStoolsUtils.WINE_FOLDER)
|
||||
return ((wine_folder != None) and (wine_folder != ""))
|
||||
|
||||
@staticmethod
|
||||
def LAStoolsPath():
|
||||
folder = ProcessingConfig.getSetting(LAStoolsUtils.LASTOOLS_FOLDER)
|
||||
if folder == None:
|
||||
folder =""
|
||||
|
||||
lastools_folder = ProcessingConfig.getSetting(LAStoolsUtils.LASTOOLS_FOLDER)
|
||||
if lastools_folder == None:
|
||||
lastools_folder = ""
|
||||
wine_folder = ProcessingConfig.getSetting(LAStoolsUtils.WINE_FOLDER)
|
||||
if (wine_folder == None) or (wine_folder == ""):
|
||||
folder = lastools_folder
|
||||
else:
|
||||
folder = wine_folder + "/wine " + lastools_folder
|
||||
return folder
|
||||
|
||||
|
||||
@staticmethod
|
||||
def runLAStools(commands, progress):
|
||||
loglines = []
|
||||
loglines.append("LAStools console output")
|
||||
commandline = " ".join(commands)
|
||||
loglines.append("LAStools command line")
|
||||
loglines.append(commandline)
|
||||
loglines.append("LAStools console output")
|
||||
proc = subprocess.Popen(commandline, shell=True, stdout=subprocess.PIPE, stdin=open(os.devnull),
|
||||
stderr=subprocess.STDOUT, universal_newlines=False).stdout
|
||||
for line in iter(proc.readline, ""):
|
||||
|
@ -28,6 +28,7 @@ from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class blast2dem(LAStoolsAlgorithm):
|
||||
|
||||
@ -35,7 +36,7 @@ class blast2dem(LAStoolsAlgorithm):
|
||||
PRODUCT = "PRODUCT"
|
||||
ATTRIBUTES = ["elevation", "slope", "intensity", "rgb"]
|
||||
PRODUCTS = ["actual values", "hillshade", "gray", "false"]
|
||||
|
||||
USE_TILE_BB = "USE_TILE_BB"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "blast2dem"
|
||||
@ -46,10 +47,12 @@ class blast2dem(LAStoolsAlgorithm):
|
||||
self.addParametersStepGUI()
|
||||
self.addParameter(ParameterSelection(blast2dem.ATTRIBUTE, "Attribute", blast2dem.ATTRIBUTES, 0))
|
||||
self.addParameter(ParameterSelection(blast2dem.PRODUCT, "Product", blast2dem.PRODUCTS, 0))
|
||||
self.addParameter(ParameterBoolean(blast2dem.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
|
||||
self.addParametersRasterOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
@ -60,6 +63,9 @@ class blast2dem(LAStoolsAlgorithm):
|
||||
product = self.getParameterValue(blast2dem.PRODUCT)
|
||||
if product != 0:
|
||||
commands.append("-" + blast2dem.PRODUCTS[product])
|
||||
if (self.getParameterValue(blast2dem.USE_TILE_BB)):
|
||||
commands.append("-use_tile_bb")
|
||||
self.addParametersRasterOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -0,0 +1,81 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
blast2demPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class blast2demPro(LAStoolsAlgorithm):
|
||||
|
||||
ATTRIBUTE = "ATTRIBUTE"
|
||||
PRODUCT = "PRODUCT"
|
||||
ATTRIBUTES = ["elevation", "slope", "intensity", "rgb"]
|
||||
PRODUCTS = ["actual values", "hillshade", "gray", "false"]
|
||||
USE_TILE_BB = "USE_TILE_BB"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "blast2demPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersPointInputMergedGUI()
|
||||
self.addParametersFilter1ReturnClassFlagsGUI()
|
||||
self.addParametersStepGUI()
|
||||
self.addParameter(ParameterSelection(blast2demPro.ATTRIBUTE, "Attribute", blast2demPro.ATTRIBUTES, 0))
|
||||
self.addParameter(ParameterSelection(blast2demPro.PRODUCT, "Product", blast2demPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterBoolean(blast2demPro.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersRasterOutputFormatGUI()
|
||||
self.addParametersRasterOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersPointInputMergedCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
self.addParametersStepCommands(commands)
|
||||
attribute = self.getParameterValue(blast2demPro.ATTRIBUTE)
|
||||
if attribute != 0:
|
||||
commands.append("-" + blast2demPro.ATTRIBUTES[attribute])
|
||||
product = self.getParameterValue(blast2demPro.PRODUCT)
|
||||
if product != 0:
|
||||
commands.append("-" + blast2demPro.PRODUCTS[product])
|
||||
if (self.getParameterValue(blast2demPro.USE_TILE_BB)):
|
||||
commands.append("-use_tile_bb")
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersRasterOutputFormatCommands(commands)
|
||||
self.addParametersRasterOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -48,9 +48,10 @@ class blast2iso(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2iso.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2iso")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
smooth = self.getParameterValue(blast2iso.SMOOTH)
|
||||
@ -72,5 +73,6 @@ class blast2iso(LAStoolsAlgorithm):
|
||||
commands.append("-clean")
|
||||
commands.append(str(clean))
|
||||
self.addParametersVectorOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -0,0 +1,88 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
blast2isoPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterNumber
|
||||
|
||||
class blast2isoPro(LAStoolsAlgorithm):
|
||||
|
||||
SMOOTH = "SMOOTH"
|
||||
ISO_EVERY = "ISO_EVERY"
|
||||
SIMPLIFY_LENGTH = "SIMPLIFY_LENGTH"
|
||||
SIMPLIFY_AREA = "SIMPLIFY_AREA"
|
||||
CLEAN = "CLEAN"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "blast2isoPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersPointInputMergedGUI()
|
||||
self.addParameter(ParameterNumber(blast2isoPro.SMOOTH, "smooth underlying TIN", 0, None, 0))
|
||||
self.addParameter(ParameterNumber(blast2isoPro.ISO_EVERY, "extract isoline with a spacing of", 0, None, 10.0))
|
||||
self.addParameter(ParameterNumber(blast2isoPro.CLEAN, "clean isolines shorter than (0 = do not clean)", None, None, 0.0))
|
||||
self.addParameter(ParameterNumber(blast2isoPro.SIMPLIFY_LENGTH, "simplify segments shorter than (0 = do not simplify)", None, None, 0.0))
|
||||
self.addParameter(ParameterNumber(blast2isoPro.SIMPLIFY_AREA, "simplify segments pairs with area less than (0 = do not simplify)", None, None, 0.0))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersVectorOutputFormatGUI()
|
||||
self.addParametersVectorOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2iso")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersPointInputMergedCommands(commands)
|
||||
smooth = self.getParameterValue(blast2isoPro.SMOOTH)
|
||||
if smooth != 0:
|
||||
commands.append("-smooth")
|
||||
commands.append(str(smooth))
|
||||
commands.append("-iso_every")
|
||||
commands.append(str(self.getParameterValue(blast2isoPro.ISO_EVERY)))
|
||||
simplify_length = self.getParameterValue(blast2isoPro.SIMPLIFY_LENGTH)
|
||||
if simplify_length != 0:
|
||||
commands.append("-simplify_length")
|
||||
commands.append(str(simplify_length))
|
||||
simplify_area = self.getParameterValue(blast2isoPro.SIMPLIFY_AREA)
|
||||
if simplify_area != 0:
|
||||
commands.append("-simplify_area")
|
||||
commands.append(str(simplify_area))
|
||||
clean = self.getParameterValue(blast2isoPro.CLEAN)
|
||||
if clean != 0:
|
||||
commands.append("-clean")
|
||||
commands.append(str(clean))
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersVectorOutputFormatCommands(commands)
|
||||
self.addParametersVectorOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -60,7 +60,7 @@ class flightlinesToCHM(LAStoolsAlgorithm):
|
||||
|
||||
# first we tile the data
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
commands.append("-files_are_flightlines")
|
||||
@ -83,7 +83,7 @@ class flightlinesToCHM(LAStoolsAlgorithm):
|
||||
|
||||
# then we ground classify the tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*.laz")
|
||||
method = self.getParameterValue(flightlinesToCHM.TERRAIN)
|
||||
@ -105,7 +105,7 @@ class flightlinesToCHM(LAStoolsAlgorithm):
|
||||
|
||||
# then we height-normalize the tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_g.laz")
|
||||
commands.append("-replace_z")
|
||||
@ -119,7 +119,7 @@ class flightlinesToCHM(LAStoolsAlgorithm):
|
||||
|
||||
# then we thin and splat the tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_gh.laz")
|
||||
beam_width = self.getParameterValue(flightlinesToCHM.BEAM_WIDTH)
|
||||
@ -140,7 +140,7 @@ class flightlinesToCHM(LAStoolsAlgorithm):
|
||||
|
||||
# then we rasterize the classified tiles into CHMs
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_ght.laz")
|
||||
self.addParametersStepCommands(commands)
|
||||
|
@ -58,7 +58,7 @@ class flightlinesToDTMandDSM(LAStoolsAlgorithm):
|
||||
|
||||
# first we tile the data
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
commands.append("-files_are_flightlines")
|
||||
@ -81,7 +81,7 @@ class flightlinesToDTMandDSM(LAStoolsAlgorithm):
|
||||
|
||||
# then we ground classify the tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*.laz")
|
||||
method = self.getParameterValue(flightlinesToDTMandDSM.TERRAIN)
|
||||
@ -103,7 +103,7 @@ class flightlinesToDTMandDSM(LAStoolsAlgorithm):
|
||||
|
||||
# then we rasterize the classified tiles into DTMs
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_g.laz")
|
||||
commands.append("-keep_class")
|
||||
@ -122,7 +122,7 @@ class flightlinesToDTMandDSM(LAStoolsAlgorithm):
|
||||
|
||||
# then we rasterize the classified tiles into DSMs
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, base_name+"*_g.laz")
|
||||
commands.append("-first_only")
|
||||
|
@ -60,7 +60,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# first we tile the data
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
commands.append("-files_are_flightlines")
|
||||
@ -79,7 +79,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we ground classify the tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*.laz")
|
||||
method = self.getParameterValue(flightlinesToSingleCHMpitFree.TERRAIN)
|
||||
@ -101,7 +101,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we height-normalize the tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_g.laz")
|
||||
commands.append("-replace_z")
|
||||
@ -115,7 +115,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we thin and splat the tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_gh.laz")
|
||||
beam_width = self.getParameterValue(flightlinesToSingleCHMpitFree.BEAM_WIDTH)
|
||||
@ -135,7 +135,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we rasterize the classified tiles into the partial CHMs at level 00
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
|
||||
self.addParametersStepCommands(commands)
|
||||
@ -152,7 +152,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we rasterize the classified tiles into the partial CHMs at level 02
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
|
||||
commands.append("-drop_z_below")
|
||||
@ -173,7 +173,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we rasterize the classified tiles into the partial CHMs at level 05
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
|
||||
commands.append("-drop_z_below")
|
||||
@ -194,7 +194,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we rasterize the classified tiles into the partial CHMs at level 10
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
|
||||
commands.append("-drop_z_below")
|
||||
@ -215,7 +215,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we rasterize the classified tiles into the partial CHMs at level 15
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
|
||||
commands.append("-drop_z_below")
|
||||
@ -236,7 +236,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we rasterize the classified tiles into the partial CHMs at level 20
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile*_ght.laz")
|
||||
commands.append("-drop_z_below")
|
||||
@ -257,7 +257,7 @@ class flightlinesToSingleCHMpitFree(LAStoolsAlgorithm):
|
||||
|
||||
# then we combine the partial CHMs into a single output CHM
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasgrid.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasgrid")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "tile_chm*.bil")
|
||||
commands.append("-highest")
|
||||
|
@ -59,7 +59,7 @@ class hugeFileClassify(LAStoolsAlgorithm):
|
||||
|
||||
# first we tile the data with option '-reversible'
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
tile_size = self.getParameterValue(hugeFileClassify.TILE_SIZE)
|
||||
@ -78,7 +78,7 @@ class hugeFileClassify(LAStoolsAlgorithm):
|
||||
|
||||
# then we ground classify the reversible tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileClassify*.laz")
|
||||
airborne = self.getParameterValue(hugeFileClassify.AIRBORNE)
|
||||
@ -100,7 +100,7 @@ class hugeFileClassify(LAStoolsAlgorithm):
|
||||
|
||||
# then we compute the height for each points in the reversible tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileClassify*_g.laz")
|
||||
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
|
||||
@ -113,7 +113,7 @@ class hugeFileClassify(LAStoolsAlgorithm):
|
||||
|
||||
# then we classify buildings and trees in the reversible tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclassify.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclassify")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileClassify*_gh.laz")
|
||||
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
|
||||
@ -126,7 +126,7 @@ class hugeFileClassify(LAStoolsAlgorithm):
|
||||
|
||||
# then we reverse the tiling
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileClassify*_ghc.laz")
|
||||
commands.append("-reverse_tiling")
|
||||
|
@ -59,7 +59,7 @@ class hugeFileGroundClassify(LAStoolsAlgorithm):
|
||||
|
||||
# first we tile the data with option '-reversible'
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
tile_size = self.getParameterValue(hugeFileGroundClassify.TILE_SIZE)
|
||||
@ -78,7 +78,7 @@ class hugeFileGroundClassify(LAStoolsAlgorithm):
|
||||
|
||||
# then we ground classify the reversible tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileGroundClassify*.laz")
|
||||
airborne = self.getParameterValue(hugeFileGroundClassify.AIRBORNE)
|
||||
@ -100,7 +100,7 @@ class hugeFileGroundClassify(LAStoolsAlgorithm):
|
||||
|
||||
# then we reverse the tiling
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileGroundClassify*_g.laz")
|
||||
commands.append("-reverse_tiling")
|
||||
|
@ -59,7 +59,7 @@ class hugeFileNormalize(LAStoolsAlgorithm):
|
||||
|
||||
# first we tile the data with option '-reversible'
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
tile_size = self.getParameterValue(hugeFileNormalize.TILE_SIZE)
|
||||
@ -78,7 +78,7 @@ class hugeFileNormalize(LAStoolsAlgorithm):
|
||||
|
||||
# then we ground classify the reversible tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileNormalize*.laz")
|
||||
airborne = self.getParameterValue(hugeFileNormalize.AIRBORNE)
|
||||
@ -100,7 +100,7 @@ class hugeFileNormalize(LAStoolsAlgorithm):
|
||||
|
||||
# then we height-normalize each points in the reversible tiles
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileNormalize*_g.laz")
|
||||
self.addParametersTemporaryDirectoryAsOutputDirectoryCommands(commands)
|
||||
@ -114,7 +114,7 @@ class hugeFileNormalize(LAStoolsAlgorithm):
|
||||
|
||||
# then we reverse the tiling
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersTemporaryDirectoryAsInputFilesCommands(commands, "hugeFileNormalize*_gh.laz")
|
||||
commands.append("-reverse_tiling")
|
||||
|
@ -33,6 +33,7 @@ from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class las2dem(LAStoolsAlgorithm):
|
||||
|
||||
@ -40,7 +41,7 @@ class las2dem(LAStoolsAlgorithm):
|
||||
PRODUCT = "PRODUCT"
|
||||
ATTRIBUTES = ["elevation", "slope", "intensity", "rgb", "edge_longest", "edge_shortest"]
|
||||
PRODUCTS = ["actual values", "hillshade", "gray", "false"]
|
||||
|
||||
USE_TILE_BB = "USE_TILE_BB"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "las2dem"
|
||||
@ -51,10 +52,12 @@ class las2dem(LAStoolsAlgorithm):
|
||||
self.addParametersStepGUI()
|
||||
self.addParameter(ParameterSelection(las2dem.ATTRIBUTE, "Attribute", las2dem.ATTRIBUTES, 0))
|
||||
self.addParameter(ParameterSelection(las2dem.PRODUCT, "Product", las2dem.PRODUCTS, 0))
|
||||
self.addParameter(ParameterBoolean(las2dem.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
|
||||
self.addParametersRasterOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
@ -65,6 +68,9 @@ class las2dem(LAStoolsAlgorithm):
|
||||
product = self.getParameterValue(las2dem.PRODUCT)
|
||||
if product != 0:
|
||||
commands.append("-" + las2dem.PRODUCTS[product])
|
||||
if (self.getParameterValue(las2dem.USE_TILE_BB)):
|
||||
commands.append("-use_tile_bb")
|
||||
self.addParametersRasterOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -33,6 +33,7 @@ from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class las2demPro(LAStoolsAlgorithm):
|
||||
|
||||
@ -40,7 +41,7 @@ class las2demPro(LAStoolsAlgorithm):
|
||||
PRODUCT = "PRODUCT"
|
||||
ATTRIBUTES = ["elevation", "slope", "intensity", "rgb", "edge_longest", "edge_shortest"]
|
||||
PRODUCTS = ["actual values", "hillshade", "gray", "false"]
|
||||
|
||||
USE_TILE_BB = "USE_TILE_BB"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "las2demPro"
|
||||
@ -50,6 +51,7 @@ class las2demPro(LAStoolsAlgorithm):
|
||||
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.addParameter(ParameterBoolean(las2demPro.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersRasterOutputFormatGUI()
|
||||
@ -58,7 +60,7 @@ class las2demPro(LAStoolsAlgorithm):
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2dem")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
@ -69,9 +71,11 @@ class las2demPro(LAStoolsAlgorithm):
|
||||
product = self.getParameterValue(las2demPro.PRODUCT)
|
||||
if product != 0:
|
||||
commands.append("-" + las2demPro.PRODUCTS[product])
|
||||
if (self.getParameterValue(las2demPro.USE_TILE_BB)):
|
||||
commands.append("-use_tile_bb")
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersRasterOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
|
@ -52,9 +52,10 @@ class las2iso(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2iso.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2iso")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
smooth = self.getParameterValue(las2iso.SMOOTH)
|
||||
@ -76,5 +77,6 @@ class las2iso(LAStoolsAlgorithm):
|
||||
commands.append("-clean")
|
||||
commands.append(str(clean))
|
||||
self.addParametersVectorOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
las2las.py
|
||||
las2lasPro_filter.py
|
||||
---------------------
|
||||
Date : September 2013
|
||||
Copyright : (C) 2013 by Martin Isenburg
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
@ -18,8 +18,8 @@
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'September 2013'
|
||||
__copyright__ = '(C) 2013, Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
@ -27,43 +27,26 @@ import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterString
|
||||
from processing.core.parameters 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"
|
||||
class las2lasPro_filter(LAStoolsAlgorithm):
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "las2las"
|
||||
self.group = "LAStools"
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.name = "las2lasPro_filter"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersFilter1ReturnClassFlagsGUI()
|
||||
self.addParametersFilter2ReturnClassFlagsGUI()
|
||||
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.addParametersFilter2CoordsIntensityGUI()
|
||||
self.addParametersPointOutputGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
self.addParametersFilter2ReturnClassFlagsCommands(commands)
|
||||
self.addParametersFilter1CoordsIntensityCommands(commands)
|
||||
operation = self.getParameterValue(las2las.OPERATION)
|
||||
if operation != 0:
|
||||
commands.append("-" + OPERATIONS[operation])
|
||||
if operation > 7:
|
||||
commands.append(self.getParameterValue(las2las.OPERATIONARG))
|
||||
|
||||
self.addParametersFilter2CoordsIntensityCommands(commands)
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -0,0 +1,111 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
las2lasPro_project.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterNumber
|
||||
from processing.core.parameters import ParameterString
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
class las2lasPro_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", "ecef"]
|
||||
|
||||
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 = "las2lasPro_project"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterSelection(las2lasPro_project.SOURCE_PROJECTION, "source projection", las2lasPro_project.PROJECTIONS, 0))
|
||||
self.addParameter(ParameterSelection(las2lasPro_project.SOURCE_UTM, "source utm zone", las2lasPro_project.UTM_ZONES, 0))
|
||||
self.addParameter(ParameterSelection(las2lasPro_project.SOURCE_SP, "source state plane code", las2lasPro_project.STATE_PLANES, 0))
|
||||
self.addParameter(ParameterSelection(las2lasPro_project.TARGET_PROJECTION, "target projection", las2lasPro_project.PROJECTIONS, 0))
|
||||
self.addParameter(ParameterSelection(las2lasPro_project.TARGET_UTM, "target utm zone", las2lasPro_project.UTM_ZONES, 0))
|
||||
self.addParameter(ParameterSelection(las2lasPro_project.TARGET_SP, "target state plane code", las2lasPro_project.STATE_PLANES, 0))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
source_projection = self.getParameterValue(las2lasPro_project.SOURCE_PROJECTION)
|
||||
if source_projection != 0:
|
||||
if source_projection == 1:
|
||||
source_utm_zone = self.getParameterValue(las2lasPro_project.SOURCE_UTM)
|
||||
if source_utm_zone != 0:
|
||||
commands.append("-" + las2lasPro_project.PROJECTIONS[source_projection])
|
||||
if source_utm_zone > 60:
|
||||
commands.append(str(source_utm_zone - 60) + "M")
|
||||
else:
|
||||
commands.append(str(source_utm_zone) + "N")
|
||||
elif source_projection < 4:
|
||||
source_sp_code = self.getParameterValue(las2lasPro_project.SOURCE_SP)
|
||||
if source_sp_code != 0:
|
||||
commands.append("-" + las2lasPro_project.PROJECTIONS[source_projection])
|
||||
commands.append(las2lasPro_project.STATE_PLANES[source_sp_code])
|
||||
else:
|
||||
commands.append("-" + las2lasPro_project.PROJECTIONS[source_projection])
|
||||
target_projection = self.getParameterValue(las2lasPro_project.TARGET_PROJECTION)
|
||||
if target_projection != 0:
|
||||
if target_projection == 1:
|
||||
target_utm_zone = self.getParameterValue(las2lasPro_project.TARGET_UTM)
|
||||
if target_utm_zone != 0:
|
||||
commands.append("-target_" + las2lasPro_project.PROJECTIONS[target_projection])
|
||||
if target_utm_zone > 60:
|
||||
commands.append(str(target_utm_zone - 60) + "M")
|
||||
else:
|
||||
commands.append(str(target_utm_zone) + "N")
|
||||
elif target_projection < 4:
|
||||
target_sp_code = self.getParameterValue(las2lasPro_project.TARGET_SP)
|
||||
if target_sp_code != 0:
|
||||
commands.append("-target_" + las2lasPro_project.PROJECTIONS[target_projection])
|
||||
commands.append(las2lasPro_project.STATE_PLANES[target_sp_code])
|
||||
else:
|
||||
commands.append("-target_" + las2lasPro_project.PROJECTIONS[target_projection])
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -0,0 +1,75 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
las2lasPro_transform.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterString
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
class las2lasPro_transform(LAStoolsAlgorithm):
|
||||
|
||||
OPERATION = "OPERATION"
|
||||
OPERATIONS = ["---", "set_point_type", "set_point_size", "set_version_minor", "set_version_major", "start_at_point", "stop_at_point", "remove_vlr", "week_to_adjusted", "adjusted_to_week", "auto_reoffset", "scale_rgb_up", "scale_rgb_down", "remove_all_vlrs", "remove_extra", "clip_to_bounding_box"]
|
||||
OPERATIONARG = "OPERATIONARG"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "las2lasPro_transform"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersTransform1CoordinateGUI()
|
||||
self.addParametersTransform2CoordinateGUI()
|
||||
self.addParametersTransform1OtherGUI()
|
||||
self.addParametersTransform2OtherGUI()
|
||||
self.addParameter(ParameterSelection(las2lasPro_transform.OPERATION, "operations (first 8 need an argument)", las2lasPro_transform.OPERATIONS, 0))
|
||||
self.addParameter(ParameterString(las2lasPro_transform.OPERATIONARG, "argument for operation"))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersTransform1CoordinateCommands(commands)
|
||||
self.addParametersTransform2CoordinateCommands(commands)
|
||||
self.addParametersTransform1OtherCommands(commands)
|
||||
self.addParametersTransform2OtherCommands(commands)
|
||||
operation = self.getParameterValue(las2lasPro_transform.OPERATION)
|
||||
if operation != 0:
|
||||
commands.append("-" + las2lasPro_transform.OPERATIONS[operation])
|
||||
if operation > 8:
|
||||
commands.append(self.getParameterValue(las2lasPro_transform.OPERATIONARG))
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -40,17 +40,18 @@ class las2las_filter(LAStoolsAlgorithm):
|
||||
self.addParametersFilter1CoordsIntensityGUI()
|
||||
self.addParametersFilter2CoordsIntensityGUI()
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
self.addParametersFilter2ReturnClassFlagsCommands(commands)
|
||||
self.addParametersFilter1CoordsIntensityCommands(commands)
|
||||
self.addParametersFilter2CoordsIntensityCommands(commands)
|
||||
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -38,7 +38,7 @@ class las2las_project(LAStoolsAlgorithm):
|
||||
|
||||
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"]
|
||||
PROJECTIONS = ["---", "utm", "sp83", "sp27", "longlat", "latlong", "ecef"]
|
||||
|
||||
SOURCE_PROJECTION = "SOURCE_PROJECTION"
|
||||
SOURCE_UTM = "SOURCE_UTM"
|
||||
@ -60,10 +60,11 @@ class las2las_project(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
source_projection = self.getParameterValue(las2las_project.SOURCE_PROJECTION)
|
||||
@ -73,9 +74,9 @@ class las2las_project(LAStoolsAlgorithm):
|
||||
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")
|
||||
commands.append(str(source_utm_zone - 60) + "M")
|
||||
else:
|
||||
commands.append(str(source_utm_zone - 1) + "K")
|
||||
commands.append(str(source_utm_zone) + "N")
|
||||
elif source_projection < 4:
|
||||
source_sp_code = self.getParameterValue(las2las_project.SOURCE_SP)
|
||||
if source_sp_code != 0:
|
||||
@ -90,9 +91,9 @@ class las2las_project(LAStoolsAlgorithm):
|
||||
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")
|
||||
commands.append(str(target_utm_zone - 60) + "M")
|
||||
else:
|
||||
commands.append(str(target_utm_zone - 1) + "K")
|
||||
commands.append(str(target_utm_zone) + "N")
|
||||
elif target_projection < 4:
|
||||
target_sp_code = self.getParameterValue(las2las_project.TARGET_SP)
|
||||
if target_sp_code != 0:
|
||||
@ -101,5 +102,6 @@ class las2las_project(LAStoolsAlgorithm):
|
||||
else:
|
||||
commands.append("-target_" + las2las_project.PROJECTIONS[target_projection])
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -33,7 +33,7 @@ from processing.core.parameters import ParameterSelection
|
||||
class las2las_transform(LAStoolsAlgorithm):
|
||||
|
||||
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"]
|
||||
OPERATIONS = ["---", "set_point_type", "set_point_size", "set_version_minor", "set_version_major", "start_at_point", "stop_at_point", "remove_vlr", "week_to_adjusted", "adjusted_to_week", "auto_reoffset", "scale_rgb_up", "scale_rgb_down", "remove_all_vlrs", "remove_extra", "clip_to_bounding_box"]
|
||||
OPERATIONARG = "OPERATIONARG"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
@ -45,13 +45,14 @@ class las2las_transform(LAStoolsAlgorithm):
|
||||
self.addParametersTransform2CoordinateGUI()
|
||||
self.addParametersTransform1OtherGUI()
|
||||
self.addParametersTransform2OtherGUI()
|
||||
self.addParameter(ParameterSelection(las2las_transform.OPERATION, "operations (first 7 need an argument)", las2las_transform.OPERATIONS, 0))
|
||||
self.addParameter(ParameterSelection(las2las_transform.OPERATION, "operations (first 8 need an argument)", las2las_transform.OPERATIONS, 0))
|
||||
self.addParameter(ParameterString(las2las_transform.OPERATIONARG, "argument for operation"))
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2las")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersTransform1CoordinateCommands(commands)
|
||||
@ -61,9 +62,9 @@ class las2las_transform(LAStoolsAlgorithm):
|
||||
operation = self.getParameterValue(las2las_transform.OPERATION)
|
||||
if operation != 0:
|
||||
commands.append("-" + las2las_transform.OPERATIONS[operation])
|
||||
if operation > 7:
|
||||
if operation > 8:
|
||||
commands.append(self.getParameterValue(las2las_transform.OPERATIONARG))
|
||||
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -45,9 +45,10 @@ class las2shp(LAStoolsAlgorithm):
|
||||
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.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2shp.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2shp")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
if self.getParameterValue(las2shp.POINT_Z):
|
||||
@ -58,5 +59,6 @@ class las2shp(LAStoolsAlgorithm):
|
||||
commands.append(str(record_size))
|
||||
commands.append("-o")
|
||||
commands.append(self.getOutputValue(las2shp.OUTPUT))
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -42,12 +42,14 @@ class las2tin(LAStoolsAlgorithm):
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParametersFilter1ReturnClassFlagsGUI()
|
||||
self.addParametersVectorOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2tin.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2tin")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
self.addParametersVectorOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -32,7 +32,7 @@ from processing.core.outputs import OutputFile
|
||||
|
||||
class las2txt(LAStoolsAlgorithm):
|
||||
|
||||
PARSE_STRING = "PARSE_STRING"
|
||||
PARSE = "PARSE"
|
||||
OUTPUT = "OUTPUT"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
@ -40,18 +40,20 @@ class las2txt(LAStoolsAlgorithm):
|
||||
self.group = "LAStools"
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParameter(ParameterString(las2txt.PARSE_STRING, "parse_string", "xyz"))
|
||||
self.addParameter(ParameterString(las2txt.PARSE, "parse string", "xyz"))
|
||||
self.addOutput(OutputFile(las2txt.OUTPUT, "Output ASCII file"))
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
parse_string = self.getParameterValue(las2txt.PARSE_STRING)
|
||||
if parse_string != "xyz":
|
||||
commands.append("-parse_string")
|
||||
commands.append(parse_string)
|
||||
parse = self.getParameterValue(las2txt.PARSE)
|
||||
if parse != "xyz":
|
||||
commands.append("-parse")
|
||||
commands.append(parse)
|
||||
commands.append("-o")
|
||||
commands.append(self.getOutputValue(las2txt.OUTPUT))
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
61
python/plugins/processing/algs/lidar/lastools/las2txtPro.py
Normal file
61
python/plugins/processing/algs/lidar/lastools/las2txtPro.py
Normal file
@ -0,0 +1,61 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
las2txtPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterString
|
||||
|
||||
class las2txtPro(LAStoolsAlgorithm):
|
||||
|
||||
PARSE = "PARSE"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "las2txtPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterString(las2txtPro.PARSE, "parse string", "xyz"))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2txt")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
parse = self.getParameterValue(las2txtPro.PARSE)
|
||||
if parse != "xyz":
|
||||
commands.append("-parse")
|
||||
commands.append(parse)
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
commands.append("-otxt")
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -28,15 +28,17 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from PyQt4 import QtGui
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterNumber
|
||||
|
||||
class lasboundary(LAStoolsAlgorithm):
|
||||
|
||||
MODE = "MODE"
|
||||
MODES = ["points", "spatial index (the *.lax file)", "bounding box"]
|
||||
CONCAVITY = "CONCAVITY"
|
||||
DISJOINT = "DISJOINT"
|
||||
HOLES = "HOLES"
|
||||
@ -47,23 +49,33 @@ class lasboundary(LAStoolsAlgorithm):
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParametersFilter1ReturnClassFlagsGUI()
|
||||
self.addParameter(ParameterSelection(lasboundary.MODE, "compute boundary based on", lasboundary.MODES, 0))
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasboundary.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasboundary")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
concavity = self.getParameterValue(lasboundary.CONCAVITY)
|
||||
commands.append("-concavity")
|
||||
commands.append(str(concavity))
|
||||
if self.getParameterValue(lasboundary.HOLES):
|
||||
commands.append("-holes")
|
||||
if self.getParameterValue(lasboundary.DISJOINT):
|
||||
commands.append("-disjoint")
|
||||
mode = self.getParameterValue(lasboundary.MODE)
|
||||
if (mode != 0):
|
||||
if (mode == 1):
|
||||
commands.append("-use_lax")
|
||||
else:
|
||||
commands.append("-use_bb")
|
||||
else:
|
||||
concavity = self.getParameterValue(lasboundary.CONCAVITY)
|
||||
commands.append("-concavity")
|
||||
commands.append(str(concavity))
|
||||
if self.getParameterValue(lasboundary.HOLES):
|
||||
commands.append("-holes")
|
||||
if self.getParameterValue(lasboundary.DISJOINT):
|
||||
commands.append("-disjoint")
|
||||
self.addParametersVectorOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -0,0 +1,83 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasboundaryPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterNumber
|
||||
|
||||
class lasboundaryPro(LAStoolsAlgorithm):
|
||||
|
||||
MODE = "MODE"
|
||||
MODES = ["points", "spatial index (the *.lax file)", "bounding box"]
|
||||
CONCAVITY = "CONCAVITY"
|
||||
DISJOINT = "DISJOINT"
|
||||
HOLES = "HOLES"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasboundaryPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersFilter1ReturnClassFlagsGUI()
|
||||
self.addParameter(ParameterSelection(lasboundaryPro.MODE, "compute boundary based on", lasboundaryPro.MODES, 0))
|
||||
self.addParameter(ParameterNumber(lasboundaryPro.CONCAVITY, "concavity", 0, None, 50.0))
|
||||
self.addParameter(ParameterBoolean(lasboundaryPro.HOLES, "interior holes", False))
|
||||
self.addParameter(ParameterBoolean(lasboundaryPro.DISJOINT, "disjoint polygon", False))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersVectorOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasboundary")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
mode = self.getParameterValue(lasboundaryPro.MODE)
|
||||
if (mode != 0):
|
||||
if (mode == 1):
|
||||
commands.append("-use_lax")
|
||||
else:
|
||||
commands.append("-use_bb")
|
||||
else:
|
||||
concavity = self.getParameterValue(lasboundaryPro.CONCAVITY)
|
||||
commands.append("-concavity")
|
||||
commands.append(str(concavity))
|
||||
if self.getParameterValue(lasboundaryPro.HOLES):
|
||||
commands.append("-holes")
|
||||
if self.getParameterValue(lasboundaryPro.DISJOINT):
|
||||
commands.append("-disjoint")
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersVectorOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -34,6 +34,7 @@ from processing.core.parameters import ParameterSelection
|
||||
|
||||
class lascanopy(LAStoolsAlgorithm):
|
||||
|
||||
PLOT_SIZE = "PLOT_SIZE"
|
||||
HEIGHT_CUTOFF = "HEIGHT_CUTOFF"
|
||||
ATTRIBUTE = "ATTRIBUTE"
|
||||
PRODUCT1 = "PRODUCT1"
|
||||
@ -45,18 +46,21 @@ class lascanopy(LAStoolsAlgorithm):
|
||||
PRODUCT7 = "PRODUCT7"
|
||||
PRODUCT8 = "PRODUCT8"
|
||||
PRODUCT9 = "PRODUCT9"
|
||||
PRODUCTS = ["---", "min", "max", "avg", "std", "ske", "kur", "cov", "dns",
|
||||
"p01", "p05", "p10", "p25", "p50", "p75", "p90", "p99"]
|
||||
PRODUCTS = ["---", "min", "max", "avg", "std", "ske", "kur", "qav", "cov", "dns", "all",
|
||||
"p 1", "p 5", "p 10", "p 25", "p 50", "p 75", "p 90", "p 99",
|
||||
"int_min", "int_max", "int_avg", "int_std", "int_ske", "int_kur",
|
||||
"int_p 1", "int_p 5", "int_p 10", "int_p 25", "int_p 50", "int_p 75", "int_p 90", "int_p 99"]
|
||||
COUNTS = "COUNTS"
|
||||
DENSITIES = "DENSITIES"
|
||||
USE_TILE_BB = "USE_TILE_BB"
|
||||
FILES_ARE_PLOTS = "FILES_ARE_PLOTS"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lascanopy"
|
||||
self.group = "LAStools"
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParametersStepGUI()
|
||||
self.addParameter(ParameterNumber(lascanopy.PLOT_SIZE, "square plot size", 0, None, 20))
|
||||
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))
|
||||
@ -70,13 +74,22 @@ class lascanopy(LAStoolsAlgorithm):
|
||||
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(ParameterBoolean(lascanopy.FILES_ARE_PLOTS, "input file is single plot", False))
|
||||
self.addParametersRasterOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascanopy.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascanopy")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersStepCommands(commands)
|
||||
plot_size = self.getParameterValue(lascanopy.PLOT_SIZE)
|
||||
if plot_size != 20:
|
||||
commands.append("-step")
|
||||
commands.append(str(plot_size))
|
||||
height_cutoff = self.getParameterValue(lascanopy.HEIGHT_CUTOFF)
|
||||
if height_cutoff != 1.37:
|
||||
commands.append("-height_cutoff")
|
||||
commands.append(str(height_cutoff))
|
||||
product = self.getParameterValue(lascanopy.PRODUCT1)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopy.PRODUCTS[product])
|
||||
@ -104,6 +117,21 @@ class lascanopy(LAStoolsAlgorithm):
|
||||
product = self.getParameterValue(lascanopy.PRODUCT9)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopy.PRODUCTS[product])
|
||||
array = self.getParameterValue(lascanopy.COUNTS).split()
|
||||
if (len(array) > 1):
|
||||
commands.append("-c")
|
||||
for a in array:
|
||||
commands.append(a)
|
||||
array = self.getParameterValue(lascanopy.DENSITIES).split()
|
||||
if (len(array) > 1):
|
||||
commands.append("-d")
|
||||
for a in array:
|
||||
commands.append(a)
|
||||
if (self.getParameterValue(lascanopy.USE_TILE_BB)):
|
||||
commands.append("-use_tile_bb")
|
||||
if (self.getParameterValue(lascanopy.FILES_ARE_PLOTS)):
|
||||
commands.append("-files_are_plots")
|
||||
self.addParametersRasterOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
147
python/plugins/processing/algs/lidar/lastools/lascanopyPro.py
Normal file
147
python/plugins/processing/algs/lidar/lastools/lascanopyPro.py
Normal file
@ -0,0 +1,147 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lascanopyPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterNumber
|
||||
from processing.core.parameters import ParameterString
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
class lascanopyPro(LAStoolsAlgorithm):
|
||||
|
||||
PLOT_SIZE = "PLOT_SIZE"
|
||||
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", "qav", "cov", "dns", "all",
|
||||
"p 1", "p 5", "p 10", "p 25", "p 50", "p 75", "p 90", "p 99",
|
||||
"int_min", "int_max", "int_avg", "int_std", "int_ske", "int_kur",
|
||||
"int_p 1", "int_p 5", "int_p 10", "int_p 25", "int_p 50", "int_p 75", "int_p 90", "int_p 99"]
|
||||
COUNTS = "COUNTS"
|
||||
DENSITIES = "DENSITIES"
|
||||
USE_TILE_BB = "USE_TILE_BB"
|
||||
FILES_ARE_PLOTS = "FILES_ARE_PLOTS"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lascanopyPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersPointInputMergedGUI()
|
||||
self.addParameter(ParameterNumber(lascanopyPro.PLOT_SIZE, "square plot size", 0, None, 20))
|
||||
self.addParameter(ParameterNumber(lascanopyPro.HEIGHT_CUTOFF, "height cutoff / breast height", 0, None, 1.37))
|
||||
self.addParameter(ParameterSelection(lascanopyPro.PRODUCT1, "create", lascanopyPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterSelection(lascanopyPro.PRODUCT2, "create", lascanopyPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterSelection(lascanopyPro.PRODUCT3, "create", lascanopyPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterSelection(lascanopyPro.PRODUCT4, "create", lascanopyPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterSelection(lascanopyPro.PRODUCT5, "create", lascanopyPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterSelection(lascanopyPro.PRODUCT6, "create", lascanopyPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterSelection(lascanopyPro.PRODUCT7, "create", lascanopyPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterSelection(lascanopyPro.PRODUCT8, "create", lascanopyPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterSelection(lascanopyPro.PRODUCT9, "create", lascanopyPro.PRODUCTS, 0))
|
||||
self.addParameter(ParameterString(lascanopyPro.COUNTS, "count rasters (e.g. 2.0 5.0 10.0 20.0)", ""))
|
||||
self.addParameter(ParameterString(lascanopyPro.DENSITIES, "density rasters (e.g. 2.0 5.0 10.0 20.0)", ""))
|
||||
self.addParameter(ParameterBoolean(lascanopyPro.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
|
||||
self.addParameter(ParameterBoolean(lascanopyPro.FILES_ARE_PLOTS, "input file is single plot", False))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersRasterOutputFormatGUI()
|
||||
self.addParametersRasterOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascanopy")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersPointInputMergedCommands(commands)
|
||||
plot_size = self.getParameterValue(lascanopyPro.PLOT_SIZE)
|
||||
if plot_size != 20:
|
||||
commands.append("-step")
|
||||
commands.append(str(plot_size))
|
||||
height_cutoff = self.getParameterValue(lascanopyPro.HEIGHT_CUTOFF)
|
||||
if height_cutoff != 1.37:
|
||||
commands.append("-height_cutoff")
|
||||
commands.append(str(height_cutoff))
|
||||
product = self.getParameterValue(lascanopyPro.PRODUCT1)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopyPro.PRODUCTS[product])
|
||||
product = self.getParameterValue(lascanopyPro.PRODUCT2)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopyPro.PRODUCTS[product])
|
||||
product = self.getParameterValue(lascanopyPro.PRODUCT3)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopyPro.PRODUCTS[product])
|
||||
product = self.getParameterValue(lascanopyPro.PRODUCT4)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopyPro.PRODUCTS[product])
|
||||
product = self.getParameterValue(lascanopyPro.PRODUCT5)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopyPro.PRODUCTS[product])
|
||||
product = self.getParameterValue(lascanopyPro.PRODUCT6)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopyPro.PRODUCTS[product])
|
||||
product = self.getParameterValue(lascanopyPro.PRODUCT7)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopyPro.PRODUCTS[product])
|
||||
product = self.getParameterValue(lascanopyPro.PRODUCT8)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopyPro.PRODUCTS[product])
|
||||
product = self.getParameterValue(lascanopyPro.PRODUCT9)
|
||||
if product != 0:
|
||||
commands.append("-" + lascanopyPro.PRODUCTS[product])
|
||||
array = self.getParameterValue(lascanopyPro.COUNTS).split()
|
||||
if (len(array) > 1):
|
||||
commands.append("-c")
|
||||
for a in array:
|
||||
commands.append(a)
|
||||
array = self.getParameterValue(lascanopyPro.DENSITIES).split()
|
||||
if (len(array) > 1):
|
||||
commands.append("-d")
|
||||
for a in array:
|
||||
commands.append(a)
|
||||
if (self.getParameterValue(lascanopyPro.USE_TILE_BB)):
|
||||
commands.append("-use_tile_bb")
|
||||
if (self.getParameterValue(lascanopyPro.FILES_ARE_PLOTS)):
|
||||
commands.append("-files_are_plots")
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersRasterOutputFormatCommands(commands)
|
||||
self.addParametersRasterOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -40,12 +40,14 @@ class lasclassify(LAStoolsAlgorithm):
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParametersHorizontalAndVerticalFeetGUI()
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclassify.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclassify")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersHorizontalAndVerticalFeetCommands(commands)
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -0,0 +1,55 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasclassifyPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
class lasclassifyPro(LAStoolsAlgorithm):
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasclassifyPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersHorizontalAndVerticalFeetGUI()
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclassify")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersHorizontalAndVerticalFeetCommands(commands)
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -54,9 +54,10 @@ class lasclip(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclip.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclip")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
poly = self.getParameterValue(lasclip.POLYGON)
|
||||
@ -71,5 +72,6 @@ class lasclip(LAStoolsAlgorithm):
|
||||
classify_as = self.getParameterValue(lasclip.CLASSIFY_AS)
|
||||
commands.append(str(classify_as))
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -44,9 +44,10 @@ class lascolor(LAStoolsAlgorithm):
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParameter(ParameterRaster(lascolor.ORTHO, "Input ortho"))
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascolor.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascolor")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
ortho = self.getParameterValue(lascolor.ORTHO)
|
||||
@ -54,5 +55,6 @@ class lascolor(LAStoolsAlgorithm):
|
||||
commands.append("-image")
|
||||
commands.append(ortho)
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -50,9 +50,10 @@ class lascontrol(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascontrol.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lascontrol")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
poly = self.getParameterValue(lascontrol.POLYGON)
|
||||
@ -67,5 +68,6 @@ class lascontrol(LAStoolsAlgorithm):
|
||||
classify_as = self.getParameterValue(lascontrol.CLASSIFY_AS)
|
||||
commands.append(str(classify_as))
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -47,10 +47,11 @@ class lasduplicate(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasduplicate.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasduplicate")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
if self.getParameterValue(lasduplicate.LOWEST_Z):
|
||||
@ -64,5 +65,6 @@ class lasduplicate(LAStoolsAlgorithm):
|
||||
commands.append("-record_removed")
|
||||
commands.append(record_removed)
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -0,0 +1,73 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasduplicate.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class lasduplicatePro(LAStoolsAlgorithm):
|
||||
|
||||
LOWEST_Z = "LOWEST_Z"
|
||||
UNIQUE_XYZ = "UNIQUE_XYZ"
|
||||
SINGLE_RETURNS = "SINGLE_RETURNS"
|
||||
RECORD_REMOVED = "RECORD_REMOVED"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasduplicatePro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterBoolean(lasduplicatePro.LOWEST_Z, "keep duplicate with lowest z coordinate", False))
|
||||
self.addParameter(ParameterBoolean(lasduplicatePro.UNIQUE_XYZ, "only remove duplicates in x y and z", False))
|
||||
self.addParameter(ParameterBoolean(lasduplicatePro.SINGLE_RETURNS, "mark surviving duplicate as single return", False))
|
||||
self.addParameter(ParameterBoolean(lasduplicatePro.RECORD_REMOVED, "record removed duplicates", False))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasduplicate")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
if self.getParameterValue(lasduplicatePro.LOWEST_Z):
|
||||
commands.append("-lowest_z")
|
||||
if self.getParameterValue(lasduplicatePro.UNIQUE_XYZ):
|
||||
commands.append("-unique_xyz")
|
||||
if self.getParameterValue(lasduplicatePro.SINGLE_RETURNS):
|
||||
commands.append("-single_returns")
|
||||
if self.getParameterValue(lasduplicatePro.RECORD_REMOVED):
|
||||
commands.append("-record_removed")
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -32,6 +32,7 @@ from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class lasgrid(LAStoolsAlgorithm):
|
||||
|
||||
@ -39,6 +40,7 @@ class lasgrid(LAStoolsAlgorithm):
|
||||
METHOD = "METHOD"
|
||||
ATTRIBUTES = ["elevation", "intensity", "rgb", "classification"]
|
||||
METHODS = ["lowest", "highest", "average", "stddev"]
|
||||
USE_TILE_BB = "USE_TILE_BB"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasgrid"
|
||||
@ -49,10 +51,12 @@ class lasgrid(LAStoolsAlgorithm):
|
||||
self.addParametersStepGUI()
|
||||
self.addParameter(ParameterSelection(lasgrid.ATTRIBUTE, "Attribute", lasgrid.ATTRIBUTES, 0))
|
||||
self.addParameter(ParameterSelection(lasgrid.METHOD, "Method", lasgrid.METHODS, 0))
|
||||
self.addParameter(ParameterBoolean(lasgrid.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
|
||||
self.addParametersRasterOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasgrid.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasgrid")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
@ -63,6 +67,9 @@ class lasgrid(LAStoolsAlgorithm):
|
||||
method = self.getParameterValue(lasgrid.METHOD)
|
||||
if method != 0:
|
||||
commands.append("-" + lasgrid.METHODS[method])
|
||||
if (self.getParameterValue(lasgrid.USE_TILE_BB)):
|
||||
commands.append("-use_tile_bb")
|
||||
self.addParametersRasterOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
81
python/plugins/processing/algs/lidar/lastools/lasgridPro.py
Normal file
81
python/plugins/processing/algs/lidar/lastools/lasgridPro.py
Normal file
@ -0,0 +1,81 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasgridPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
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__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class lasgridPro(LAStoolsAlgorithm):
|
||||
|
||||
ATTRIBUTE = "ATTRIBUTE"
|
||||
METHOD = "METHOD"
|
||||
ATTRIBUTES = ["elevation", "intensity", "rgb", "classification"]
|
||||
METHODS = ["lowest", "highest", "average", "stddev"]
|
||||
USE_TILE_BB = "USE_TILE_BB"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasgridPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersPointInputMergedGUI()
|
||||
self.addParametersFilter1ReturnClassFlagsGUI()
|
||||
self.addParametersStepGUI()
|
||||
self.addParameter(ParameterSelection(lasgridPro.ATTRIBUTE, "Attribute", lasgridPro.ATTRIBUTES, 0))
|
||||
self.addParameter(ParameterSelection(lasgridPro.METHOD, "Method", lasgridPro.METHODS, 0))
|
||||
self.addParameter(ParameterBoolean(lasgridPro.USE_TILE_BB, "use tile bounding box (after tiling with buffer)", False))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersRasterOutputFormatGUI()
|
||||
self.addParametersRasterOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasgrid")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersPointInputMergedCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
self.addParametersStepCommands(commands)
|
||||
attribute = self.getParameterValue(lasgridPro.ATTRIBUTE)
|
||||
if attribute != 0:
|
||||
commands.append("-" + lasgridPro.ATTRIBUTES[attribute])
|
||||
method = self.getParameterValue(lasgridPro.METHOD)
|
||||
if method != 0:
|
||||
commands.append("-" + lasgridPro.METHODS[method])
|
||||
if (self.getParameterValue(lasgridPro.USE_TILE_BB)):
|
||||
commands.append("-use_tile_bb")
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersRasterOutputFormatCommands(commands)
|
||||
self.addParametersRasterOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -36,7 +36,7 @@ from processing.core.parameters import ParameterSelection
|
||||
|
||||
class lasground(LAStoolsAlgorithm):
|
||||
|
||||
AIRBORNE = "AIRBORNE"
|
||||
NO_BULGE = "NO_BULGE"
|
||||
TERRAIN = "TERRAIN"
|
||||
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
|
||||
GRANULARITY = "GRANULARITY"
|
||||
@ -48,22 +48,26 @@ class lasground(LAStoolsAlgorithm):
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParametersHorizontalAndVerticalFeetGUI()
|
||||
self.addParameter(ParameterBoolean(lasground.AIRBORNE, "airborne LiDAR", True))
|
||||
self.addParameter(ParameterBoolean(lasground.NO_BULGE, "no triangle bulging during TIN refinement", False))
|
||||
self.addParameter(ParameterSelection(lasground.TERRAIN, "terrain type", lasground.TERRAINS, 1))
|
||||
self.addParameter(ParameterSelection(lasground.GRANULARITY, "preprocessing", lasground.GRANULARITIES, 1))
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersHorizontalAndVerticalFeetCommands(commands)
|
||||
if (self.getParameterValue(lasground.NO_BULGE)):
|
||||
commands.append("-no_bulge")
|
||||
method = self.getParameterValue(lasground.TERRAIN)
|
||||
if method != 1:
|
||||
if (method != 1):
|
||||
commands.append("-" + lasground.TERRAINS[method])
|
||||
granularity = self.getParameterValue(lasground.GRANULARITY)
|
||||
if granularity != 1:
|
||||
if (granularity != 1):
|
||||
commands.append("-" + lasground.GRANULARITIES[granularity])
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -36,7 +36,7 @@ from processing.core.parameters import ParameterSelection
|
||||
|
||||
class lasgroundPro(LAStoolsAlgorithm):
|
||||
|
||||
AIRBORNE = "AIRBORNE"
|
||||
NO_BULGE = "NO_BULGE"
|
||||
TERRAIN = "TERRAIN"
|
||||
TERRAINS = ["wilderness", "nature", "town", "city", "metro"]
|
||||
GRANULARITY = "GRANULARITY"
|
||||
@ -47,35 +47,34 @@ class lasgroundPro(LAStoolsAlgorithm):
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersHorizontalAndVerticalFeetGUI()
|
||||
self.addParameter(ParameterBoolean(lasgroundPro.AIRBORNE, "airborne LiDAR", True))
|
||||
self.addParameter(ParameterBoolean(lasgroundPro.NO_BULGE, "no triangle bulging during TIN refinement", False))
|
||||
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.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasground")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersHorizontalAndVerticalFeetCommands(commands)
|
||||
airborne = self.getParameterValue(lasgroundPro.AIRBORNE)
|
||||
if airborne != True:
|
||||
commands.append("-not_airborne")
|
||||
if (self.getParameterValue(lasgroundPro.NO_BULGE)):
|
||||
commands.append("-no_bulge")
|
||||
method = self.getParameterValue(lasgroundPro.TERRAIN)
|
||||
if method != 1:
|
||||
if (method != 1):
|
||||
commands.append("-" + lasgroundPro.TERRAINS[method])
|
||||
granularity = self.getParameterValue(lasgroundPro.GRANULARITY)
|
||||
if granularity != 1:
|
||||
if (granularity != 1):
|
||||
commands.append("-" + lasgroundPro.GRANULARITIES[granularity])
|
||||
self.addParametersCoresCommands(commands)
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasduplicate.py
|
||||
lasheight.py
|
||||
---------------------
|
||||
Date : September 2013
|
||||
Copyright : (C) 2013 by Martin Isenburg
|
||||
@ -17,9 +17,9 @@
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Victor Olaya'
|
||||
__date__ = 'August 2012'
|
||||
__copyright__ = '(C) 2012, Victor Olaya'
|
||||
__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$'
|
||||
|
||||
@ -28,10 +28,15 @@ from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterNumber
|
||||
|
||||
class lasheight(LAStoolsAlgorithm):
|
||||
|
||||
REPLACE_Z = "REPLACE_Z"
|
||||
DROP_ABOVE = "DROP_ABOVE"
|
||||
DROP_ABOVE_HEIGHT = "DROP_ABOVE_HEIGHT"
|
||||
DROP_BELOW = "DROP_BELOW"
|
||||
DROP_BELOW_HEIGHT = "DROP_BELOW_HEIGHT"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasheight"
|
||||
@ -39,16 +44,26 @@ class lasheight(LAStoolsAlgorithm):
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParameter(ParameterBoolean(lasheight.REPLACE_Z, "replace z", False))
|
||||
self.addParameter(ParameterBoolean(lasheight.DROP_ABOVE, "drop above", False))
|
||||
self.addParameter(ParameterNumber(lasheight.DROP_ABOVE_HEIGHT, "drop above height", 0, None, 100.0))
|
||||
self.addParameter(ParameterBoolean(lasheight.DROP_BELOW, "drop below", False))
|
||||
self.addParameter(ParameterNumber(lasheight.DROP_BELOW_HEIGHT, "drop below height", 0, None, -2.0))
|
||||
self.addParametersPointOutputGUI()
|
||||
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
replace_z = self.getParameterValue(lasheight.REPLACE_Z)
|
||||
if replace_z == True:
|
||||
if self.getParameterValue(lasheight.REPLACE_Z):
|
||||
commands.append("-replace_z")
|
||||
if self.getParameterValue(lasheight.DROP_ABOVE):
|
||||
commands.append("-drop_above")
|
||||
commands.append(str(self.getParameterValue(lasheight.DROP_ABOVE_HEIGHT)))
|
||||
if self.getParameterValue(lasheight.DROP_BELOW):
|
||||
commands.append("-drop_below")
|
||||
commands.append(str(self.getParameterValue(lasheight.DROP_BELOW_HEIGHT)))
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -0,0 +1,75 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasheightPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterNumber
|
||||
|
||||
class lasheightPro(LAStoolsAlgorithm):
|
||||
|
||||
REPLACE_Z = "REPLACE_Z"
|
||||
DROP_ABOVE = "DROP_ABOVE"
|
||||
DROP_ABOVE_HEIGHT = "DROP_ABOVE_HEIGHT"
|
||||
DROP_BELOW = "DROP_BELOW"
|
||||
DROP_BELOW_HEIGHT = "DROP_BELOW_HEIGHT"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasheightPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterBoolean(lasheightPro.REPLACE_Z, "replace z", False))
|
||||
self.addParameter(ParameterBoolean(lasheightPro.DROP_ABOVE, "drop above", False))
|
||||
self.addParameter(ParameterNumber(lasheightPro.DROP_ABOVE_HEIGHT, "drop above height", 0, None, 100.0))
|
||||
self.addParameter(ParameterBoolean(lasheightPro.DROP_BELOW, "drop below", False))
|
||||
self.addParameter(ParameterNumber(lasheightPro.DROP_BELOW_HEIGHT, "drop below height", 0, None, -2.0))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasheight")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
if self.getParameterValue(lasheightPro.REPLACE_Z):
|
||||
commands.append("-replace_z")
|
||||
if self.getParameterValue(lasheightPro.DROP_ABOVE):
|
||||
commands.append("-drop_above")
|
||||
commands.append(str(self.getParameterValue(lasheightPro.DROP_ABOVE_HEIGHT)))
|
||||
if self.getParameterValue(lasheightPro.DROP_BELOW):
|
||||
commands.append("-drop_below")
|
||||
commands.append(str(self.getParameterValue(lasheightPro.DROP_BELOW_HEIGHT)))
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -32,23 +32,28 @@ from processing.core.parameters import ParameterBoolean
|
||||
class lasindex(LAStoolsAlgorithm):
|
||||
|
||||
MOBILE_OR_TERRESTRIAL = "MOBILE_OR_TERRESTRIAL"
|
||||
APPEND_LAX = "APPEND_LAX"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasindex"
|
||||
self.group = "LAStools"
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParameter(ParameterBoolean(lasindex.APPEND_LAX, "append *.lax file to *.laz file", False))
|
||||
self.addParameter(ParameterBoolean(lasindex.MOBILE_OR_TERRESTRIAL, "is mobile or terrestrial LiDAR (not airborne)", False))
|
||||
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasindex.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasindex")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
if self.getParameterValue(lasindex.APPEND_LAX):
|
||||
commands.append("-append")
|
||||
if self.getParameterValue(lasindex.MOBILE_OR_TERRESTRIAL):
|
||||
commands.append("-tile_size")
|
||||
commands.append("10")
|
||||
commands.append("-maximum")
|
||||
commands.append("-100")
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
61
python/plugins/processing/algs/lidar/lastools/lasindexPro.py
Normal file
61
python/plugins/processing/algs/lidar/lastools/lasindexPro.py
Normal file
@ -0,0 +1,61 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasindexPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class lasindexPro(LAStoolsAlgorithm):
|
||||
|
||||
MOBILE_OR_TERRESTRIAL = "MOBILE_OR_TERRESTRIAL"
|
||||
APPEND_LAX = "APPEND_LAX"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasindexPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterBoolean(lasindexPro.APPEND_LAX, "append *.lax file to *.laz file", False))
|
||||
self.addParameter(ParameterBoolean(lasindexPro.MOBILE_OR_TERRESTRIAL, "is mobile or terrestrial LiDAR (not airborne)", False))
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasindex")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
if self.getParameterValue(lasindexPro.APPEND_LAX):
|
||||
commands.append("-append")
|
||||
if self.getParameterValue(lasindexPro.MOBILE_OR_TERRESTRIAL):
|
||||
commands.append("-tile_size")
|
||||
commands.append("10")
|
||||
commands.append("-maximum")
|
||||
commands.append("-100")
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -30,10 +30,24 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.outputs import OutputFile
|
||||
from processing.core.parameters import ParameterNumber
|
||||
|
||||
class lasinfo(LAStoolsAlgorithm):
|
||||
|
||||
COMPUTE_DENSITY = "COMPUTE_DENSITY"
|
||||
REPAIR_BB = "REPAIR_BB"
|
||||
REPAIR_COUNTERS = "REPAIR_COUNTERS"
|
||||
HISTO1 = "HISTO1"
|
||||
HISTO2 = "HISTO2"
|
||||
HISTO3 = "HISTO3"
|
||||
HISTOGRAM = ["---", "x", "y", "z", "intensity", "classification", "scan_angle", "user_data", "point_source", "gps_time", "X", "Y", "Z"]
|
||||
HISTO1_BIN = "HISTO1_BIN"
|
||||
HISTO2_BIN = "HISTO2_BIN"
|
||||
HISTO3_BIN = "HISTO3_BIN"
|
||||
OUTPUT = "OUTPUT"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
@ -41,13 +55,45 @@ class lasinfo(LAStoolsAlgorithm):
|
||||
self.group = "LAStools"
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParameter(ParameterBoolean(lasinfo.COMPUTE_DENSITY, "compute density", False))
|
||||
self.addParameter(ParameterBoolean(lasinfo.REPAIR_BB, "repair bounding box", False))
|
||||
self.addParameter(ParameterBoolean(lasinfo.REPAIR_COUNTERS, "repair counters", False))
|
||||
self.addParameter(ParameterSelection(lasinfo.HISTO1, "histogram", lasinfo.HISTOGRAM, 0))
|
||||
self.addParameter(ParameterNumber(lasinfo.HISTO1_BIN, "bin size", 0, None, 1.0))
|
||||
self.addParameter(ParameterSelection(lasinfo.HISTO2, "histogram", lasinfo.HISTOGRAM, 0))
|
||||
self.addParameter(ParameterNumber(lasinfo.HISTO2_BIN, "bin size", 0, None, 1.0))
|
||||
self.addParameter(ParameterSelection(lasinfo.HISTO3, "histogram", lasinfo.HISTOGRAM, 0))
|
||||
self.addParameter(ParameterNumber(lasinfo.HISTO3_BIN, "bin size", 0, None, 1.0))
|
||||
self.addOutput(OutputFile(lasinfo.OUTPUT, "Output ASCII file"))
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasinfo.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasinfo")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
if self.getParameterValue(lasinfo.COMPUTE_DENSITY):
|
||||
commands.append("-cd")
|
||||
if self.getParameterValue(lasinfo.REPAIR_BB):
|
||||
commands.append("-repair_bb")
|
||||
if self.getParameterValue(lasinfo.REPAIR_COUNTERS):
|
||||
commands.append("-repair_counters")
|
||||
histo = self.getParameterValue(lasinfo.HISTO1)
|
||||
if histo != 0:
|
||||
commands.append("-histo")
|
||||
commands.append(lasinfo.HISTOGRAM[histo])
|
||||
commands.append(str(self.getParameterValue(lasinfo.HISTO1_BIN)))
|
||||
histo = self.getParameterValue(lasinfo.HISTO2)
|
||||
if histo != 0:
|
||||
commands.append("-histo")
|
||||
commands.append(lasinfo.HISTOGRAM[histo])
|
||||
commands.append(str(self.getParameterValue(lasinfo.HISTO2_BIN)))
|
||||
histo = self.getParameterValue(lasinfo.HISTO3)
|
||||
if histo != 0:
|
||||
commands.append("-histo")
|
||||
commands.append(lasinfo.HISTOGRAM[histo])
|
||||
commands.append(str(self.getParameterValue(lasinfo.HISTO3_BIN)))
|
||||
commands.append("-o")
|
||||
commands.append(self.getOutputValue(lasinfo.OUTPUT))
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
99
python/plugins/processing/algs/lidar/lastools/lasinfoPro.py
Normal file
99
python/plugins/processing/algs/lidar/lastools/lasinfoPro.py
Normal file
@ -0,0 +1,99 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasinfoPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
from processing.core.outputs import OutputFile
|
||||
from processing.core.parameters import ParameterNumber
|
||||
|
||||
class lasinfoPro(LAStoolsAlgorithm):
|
||||
|
||||
COMPUTE_DENSITY = "COMPUTE_DENSITY"
|
||||
REPAIR_BB = "REPAIR_BB"
|
||||
REPAIR_COUNTERS = "REPAIR_COUNTERS"
|
||||
HISTO1 = "HISTO1"
|
||||
HISTO2 = "HISTO2"
|
||||
HISTO3 = "HISTO3"
|
||||
HISTOGRAM = ["---", "x", "y", "z", "intensity", "classification", "scan_angle", "user_data", "point_source", "gps_time", "X", "Y", "Z"]
|
||||
HISTO1_BIN = "HISTO1_BIN"
|
||||
HISTO2_BIN = "HISTO2_BIN"
|
||||
HISTO3_BIN = "HISTO3_BIN"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasinfoPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterBoolean(lasinfoPro.COMPUTE_DENSITY, "compute density", False))
|
||||
self.addParameter(ParameterBoolean(lasinfoPro.REPAIR_BB, "repair bounding box", False))
|
||||
self.addParameter(ParameterBoolean(lasinfoPro.REPAIR_COUNTERS, "repair counters", False))
|
||||
self.addParameter(ParameterSelection(lasinfoPro.HISTO1, "histogram", lasinfoPro.HISTOGRAM, 0))
|
||||
self.addParameter(ParameterNumber(lasinfoPro.HISTO1_BIN, "bin size", 0, None, 1.0))
|
||||
self.addParameter(ParameterSelection(lasinfoPro.HISTO2, "histogram", lasinfoPro.HISTOGRAM, 0))
|
||||
self.addParameter(ParameterNumber(lasinfoPro.HISTO2_BIN, "bin size", 0, None, 1.0))
|
||||
self.addParameter(ParameterSelection(lasinfoPro.HISTO3, "histogram", lasinfoPro.HISTOGRAM, 0))
|
||||
self.addParameter(ParameterNumber(lasinfoPro.HISTO3_BIN, "bin size", 0, None, 1.0))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasinfo")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
if self.getParameterValue(lasinfoPro.COMPUTE_DENSITY):
|
||||
commands.append("-cd")
|
||||
if self.getParameterValue(lasinfoPro.REPAIR_BB):
|
||||
commands.append("-repair_bb")
|
||||
if self.getParameterValue(lasinfoPro.REPAIR_COUNTERS):
|
||||
commands.append("-repair_counters")
|
||||
histo = self.getParameterValue(lasinfoPro.HISTO1)
|
||||
if histo != 0:
|
||||
commands.append("-histo")
|
||||
commands.append(lasinfoPro.HISTOGRAM[histo])
|
||||
commands.append(str(self.getParameterValue(lasinfoPro.HISTO1_BIN)))
|
||||
histo = self.getParameterValue(lasinfoPro.HISTO2)
|
||||
if histo != 0:
|
||||
commands.append("-histo")
|
||||
commands.append(lasinfoPro.HISTOGRAM[histo])
|
||||
commands.append(str(self.getParameterValue(lasinfoPro.HISTO2_BIN)))
|
||||
histo = self.getParameterValue(lasinfoPro.HISTO3)
|
||||
if histo != 0:
|
||||
commands.append("-histo")
|
||||
commands.append(lasinfoPro.HISTOGRAM[histo])
|
||||
commands.append(str(self.getParameterValue(lasinfoPro.HISTO3_BIN)))
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
commands.append("-otxt")
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -43,6 +43,7 @@ class lasmerge(LAStoolsAlgorithm):
|
||||
self.group = "LAStools"
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersFilesAreFlightlinesGUI()
|
||||
self.addParametersApplyFileSourceIdGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParameter(ParameterFile(lasmerge.FILE2, "2nd file"))
|
||||
self.addParameter(ParameterFile(lasmerge.FILE3, "3rd file"))
|
||||
@ -51,12 +52,11 @@ class lasmerge(LAStoolsAlgorithm):
|
||||
self.addParameter(ParameterFile(lasmerge.FILE6, "6th file"))
|
||||
self.addParameter(ParameterFile(lasmerge.FILE7, "7th file"))
|
||||
self.addParametersPointOutputGUI()
|
||||
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasmerge.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasmerge")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersFilesAreFlightlinesCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
file2 = self.getParameterValue(lasmerge.FILE2)
|
||||
if file2 != None:
|
||||
@ -82,6 +82,9 @@ class lasmerge(LAStoolsAlgorithm):
|
||||
if file7 != None:
|
||||
commands.append("-i")
|
||||
commands.append(file7)
|
||||
self.addParametersFilesAreFlightlinesCommands(commands)
|
||||
self.addParametersApplyFileSourceIdsCommands(commands)
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
51
python/plugins/processing/algs/lidar/lastools/lasmergePro.py
Normal file
51
python/plugins/processing/algs/lidar/lastools/lasmergePro.py
Normal file
@ -0,0 +1,51 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasmergePro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
class lasmergePro(LAStoolsAlgorithm):
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasmergePro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersFilesAreFlightlinesGUI()
|
||||
self.addParametersApplyFileSourceIdGUI()
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasmerge")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersFilesAreFlightlinesCommands(commands)
|
||||
self.addParametersApplyFileSourceIdsCommands(commands)
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -50,10 +50,11 @@ class lasnoise(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasnoise.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasnoise")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
isolated = self.getParameterValue(lasnoise.ISOLATED)
|
||||
@ -73,5 +74,6 @@ class lasnoise(LAStoolsAlgorithm):
|
||||
classify_as = self.getParameterValue(lasnoise.CLASSIFY_AS)
|
||||
commands.append(str(classify_as))
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
85
python/plugins/processing/algs/lidar/lastools/lasnoisePro.py
Normal file
85
python/plugins/processing/algs/lidar/lastools/lasnoisePro.py
Normal file
@ -0,0 +1,85 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasnoisePro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterNumber
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
class lasnoisePro(LAStoolsAlgorithm):
|
||||
|
||||
ISOLATED = "ISOLATED"
|
||||
STEP_XY = "STEP_XY"
|
||||
STEP_Z = "STEP_Z"
|
||||
OPERATION = "OPERATION"
|
||||
OPERATIONS = ["classify", "remove"]
|
||||
CLASSIFY_AS = "CLASSIFY_AS"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasnoisePro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterNumber(lasnoisePro.ISOLATED, "isolated if surrounding cells have only", 0, None, 5))
|
||||
self.addParameter(ParameterNumber(lasnoisePro.STEP_XY, "resolution of isolation grid in xy", 0, None, 4.0))
|
||||
self.addParameter(ParameterNumber(lasnoisePro.STEP_Z, "resolution of isolation grid in z ", 0, None, 4.0))
|
||||
self.addParameter(ParameterSelection(lasnoisePro.OPERATION, "what to do with isolated points", lasnoisePro.OPERATIONS, 0))
|
||||
self.addParameter(ParameterNumber(lasnoisePro.CLASSIFY_AS, "classify as", 0, None, 7))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasnoise")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
isolated = self.getParameterValue(lasnoisePro.ISOLATED)
|
||||
commands.append("-isolated")
|
||||
commands.append(str(isolated))
|
||||
step_xy = self.getParameterValue(lasnoisePro.STEP_XY)
|
||||
commands.append("-step_xy")
|
||||
commands.append(str(step_xy))
|
||||
step_z = self.getParameterValue(lasnoisePro.STEP_Z)
|
||||
commands.append("-step_z")
|
||||
commands.append(str(step_z))
|
||||
operation = self.getParameterValue(lasnoisePro.OPERATION)
|
||||
if operation != 0:
|
||||
commands.append("-remove_noise")
|
||||
else:
|
||||
commands.append("-classify_as")
|
||||
classify_as = self.getParameterValue(lasnoisePro.CLASSIFY_AS)
|
||||
commands.append(str(classify_as))
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -46,10 +46,11 @@ class lasoverage(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasoverage.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasoverage")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersHorizontalFeetCommands(commands)
|
||||
@ -64,5 +65,6 @@ class lasoverage(LAStoolsAlgorithm):
|
||||
elif operation == 2:
|
||||
commands.append("-remove_overage")
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -0,0 +1,75 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasoveragePro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterNumber
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
class lasoveragePro(LAStoolsAlgorithm):
|
||||
|
||||
CHECK_STEP = "CHECK_STEP"
|
||||
OPERATION = "OPERATION"
|
||||
OPERATIONS= ["classify as overlap", "flag as withheld", "remove from output"]
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasoveragePro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersHorizontalFeetGUI()
|
||||
self.addParametersFilesAreFlightlinesGUI()
|
||||
self.addParameter(ParameterNumber(lasoveragePro.CHECK_STEP, "size of grid used for scan angle check", 0, None, 1.0))
|
||||
self.addParameter(ParameterSelection(lasoveragePro.OPERATION, "mode of operation", lasoveragePro.OPERATIONS, 0))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasoverage")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersHorizontalFeetCommands(commands)
|
||||
self.addParametersFilesAreFlightlinesCommands(commands)
|
||||
step = self.getParameterValue(lasoveragePro.CHECK_STEP)
|
||||
if step != 1.0:
|
||||
commands.append("-step")
|
||||
commands.append(str(step))
|
||||
operation = self.getParameterValue(lasoveragePro.OPERATION)
|
||||
if operation == 1:
|
||||
commands.append("-flag_as_withheld")
|
||||
elif operation == 2:
|
||||
commands.append("-remove_overage")
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -53,9 +53,10 @@ class lasoverlap(LAStoolsAlgorithm):
|
||||
self.addParameter(ParameterBoolean(lasoverlap.CREATE_OVERLAP_RASTER, "create overlap raster", True))
|
||||
self.addParameter(ParameterBoolean(lasoverlap.CREATE_DIFFERENCE_RASTER, "create difference raster", True))
|
||||
self.addParametersRasterOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasoverlap.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasoverlap")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
@ -75,5 +76,6 @@ class lasoverlap(LAStoolsAlgorithm):
|
||||
if self.getParameterValue(lasoverlap.CREATE_DIFFERENCE_RASTER) != True:
|
||||
commands.append("-no_diff")
|
||||
self.addParametersRasterOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -0,0 +1,91 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasoverlapPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterNumber
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
class lasoverlapPro(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"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasoverlapPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersFilesAreFlightlinesGUI()
|
||||
self.addParametersFilter1ReturnClassFlagsGUI()
|
||||
self.addParameter(ParameterNumber(lasoverlapPro.CHECK_STEP, "size of grid used for overlap check", 0, None, 2.0))
|
||||
self.addParameter(ParameterSelection(lasoverlapPro.ATTRIBUTE, "attribute to check", lasoverlapPro.ATTRIBUTES, 0))
|
||||
self.addParameter(ParameterSelection(lasoverlapPro.OPERATION, "operation on attribute per cell", lasoverlapPro.OPERATIONS, 0))
|
||||
self.addParameter(ParameterBoolean(lasoverlapPro.CREATE_OVERLAP_RASTER, "create overlap raster", True))
|
||||
self.addParameter(ParameterBoolean(lasoverlapPro.CREATE_DIFFERENCE_RASTER, "create difference raster", True))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersRasterOutputFormatGUI()
|
||||
self.addParametersRasterOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasoverlap")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersFilesAreFlightlinesCommands(commands)
|
||||
self.addParametersFilter1ReturnClassFlagsCommands(commands)
|
||||
step = self.getParameterValue(lasoverlapPro.CHECK_STEP)
|
||||
if step != 0.0:
|
||||
commands.append("-step")
|
||||
commands.append(str(step))
|
||||
commands.append("-values")
|
||||
attribute = self.getParameterValue(lasoverlapPro.ATTRIBUTE)
|
||||
if attribute != 0:
|
||||
commands.append("-" + lasoverlapPro.ATTRIBUTES[attribute])
|
||||
operation = self.getParameterValue(lasoverlapPro.OPERATION)
|
||||
if operation != 0:
|
||||
commands.append("-" + lasoverlapPro.OPERATIONS[operation])
|
||||
if self.getParameterValue(lasoverlapPro.CREATE_OVERLAP_RASTER) != True:
|
||||
commands.append("-no_over")
|
||||
if self.getParameterValue(lasoverlapPro.CREATE_DIFFERENCE_RASTER) != True:
|
||||
commands.append("-no_diff")
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersRasterOutputFormatCommands(commands)
|
||||
self.addParametersRasterOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -43,12 +43,14 @@ class lasprecision(LAStoolsAlgorithm):
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addOutput(OutputFile(lasprecision.OUTPUT, "Output ASCII file"))
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasprecision.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasprecision")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
commands.append("-o")
|
||||
commands.append(self.getOutputValue(lasprecision.OUTPUT))
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -42,10 +42,11 @@ class lasquery(LAStoolsAlgorithm):
|
||||
self.group = "LAStools"
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParameter(ParameterExtent(self.AOI, 'area of interest'))
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasview.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasview")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
|
||||
# get area-of-interest
|
||||
@ -70,5 +71,6 @@ class lasquery(LAStoolsAlgorithm):
|
||||
commands.append(aoiCoords[2])
|
||||
commands.append(aoiCoords[1])
|
||||
commands.append(aoiCoords[3])
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -42,10 +42,11 @@ class lassort(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lassort.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lassort")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
if self.getParameterValue(lassort.BY_GPS_TIME):
|
||||
@ -53,5 +54,6 @@ class lassort(LAStoolsAlgorithm):
|
||||
if self.getParameterValue(lassort.BY_POINT_SOURCE_ID):
|
||||
commands.append("-point_source")
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
64
python/plugins/processing/algs/lidar/lastools/lassortPro.py
Normal file
64
python/plugins/processing/algs/lidar/lastools/lassortPro.py
Normal file
@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lassortPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class lassortPro(LAStoolsAlgorithm):
|
||||
|
||||
BY_GPS_TIME = "BY_GPS_TIME"
|
||||
BY_POINT_SOURCE_ID = "BY_POINT_SOURCE_ID"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lassortPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterBoolean(lassortPro.BY_GPS_TIME, "sort by GPS time", False))
|
||||
self.addParameter(ParameterBoolean(lassortPro.BY_POINT_SOURCE_ID, "sort by point source ID", False))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lassort")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
if self.getParameterValue(lassortPro.BY_GPS_TIME):
|
||||
commands.append("-gps_time")
|
||||
if self.getParameterValue(lassortPro.BY_POINT_SOURCE_ID):
|
||||
commands.append("-point_source")
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -46,9 +46,10 @@ class lassplit(LAStoolsAlgorithm):
|
||||
self.addParameter(ParameterSelection(lassplit.OPERATION, "how to split", lassplit.OPERATIONS, 0))
|
||||
self.addParameter(ParameterNumber(lassplit.INTERVAL, "interval or number", 0, None, 5))
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lassplit.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lassplit")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
digits = self.getParameterValue(lassplit.DIGITS)
|
||||
@ -65,5 +66,6 @@ class lassplit(LAStoolsAlgorithm):
|
||||
interval = self.getParameterValue(lassplit.INTERVAL)
|
||||
commands.append(str(interval))
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -37,6 +37,8 @@ class lasthin(LAStoolsAlgorithm):
|
||||
OPERATION = "OPERATION"
|
||||
OPERATIONS= ["lowest", "random", "highest"]
|
||||
WITHHELD = "WITHHELD"
|
||||
CLASSIFY_AS = "CLASSIFY_AS"
|
||||
CLASSIFY_AS_CLASS = "CLASSIFY_AS_CLASS"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasthin"
|
||||
@ -45,12 +47,14 @@ class lasthin(LAStoolsAlgorithm):
|
||||
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(ParameterBoolean(lasthin.WITHHELD, "mark thinned-away points as withheld", False))
|
||||
self.addParameter(ParameterBoolean(lasthin.CLASSIFY_AS, "classify surviving points as class", False))
|
||||
self.addParameter(ParameterNumber(lasthin.CLASSIFY_AS_CLASS, "class", 0, None, 8))
|
||||
self.addParametersPointOutputGUI()
|
||||
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
step = self.getParameterValue(lasthin.THIN_STEP)
|
||||
@ -62,6 +66,10 @@ class lasthin(LAStoolsAlgorithm):
|
||||
commands.append("-" + self.OPERATIONS[operation])
|
||||
if self.getParameterValue(lasthin.WITHHELD):
|
||||
commands.append("-withheld")
|
||||
if self.getParameterValue(lasthin.CLASSIFY_AS):
|
||||
commands.append("-classify_as")
|
||||
commands.append(str(self.getParameterValue(lasthin.CLASSIFY_AS_CLASS)))
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
81
python/plugins/processing/algs/lidar/lastools/lasthinPro.py
Normal file
81
python/plugins/processing/algs/lidar/lastools/lasthinPro.py
Normal file
@ -0,0 +1,81 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasthinPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterNumber
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
class lasthinPro(LAStoolsAlgorithm):
|
||||
|
||||
THIN_STEP = "THIN_STEP"
|
||||
OPERATION = "OPERATION"
|
||||
OPERATIONS= ["lowest", "random", "highest"]
|
||||
WITHHELD = "WITHHELD"
|
||||
CLASSIFY_AS = "CLASSIFY_AS"
|
||||
CLASSIFY_AS_CLASS = "CLASSIFY_AS_CLASS"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasthinPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterNumber(lasthinPro.THIN_STEP, "size of grid used for thinning", 0, None, 1.0))
|
||||
self.addParameter(ParameterSelection(lasthinPro.OPERATION, "keep particular point per cell", lasthinPro.OPERATIONS, 0))
|
||||
self.addParameter(ParameterBoolean(lasthinPro.WITHHELD, "mark thinned-away points as withheld", False))
|
||||
self.addParameter(ParameterBoolean(lasthinPro.CLASSIFY_AS, "classify surviving points as class", False))
|
||||
self.addParameter(ParameterNumber(lasthinPro.CLASSIFY_AS_CLASS, "class", 0, None, 8))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasthin")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
step = self.getParameterValue(lasthinPro.THIN_STEP)
|
||||
if step != 0.0:
|
||||
commands.append("-step")
|
||||
commands.append(str(step))
|
||||
operation = self.getParameterValue(lasthinPro.OPERATION)
|
||||
if operation != 0:
|
||||
commands.append("-" + self.OPERATIONS[operation])
|
||||
if self.getParameterValue(lasthinPro.WITHHELD):
|
||||
commands.append("-withheld")
|
||||
if self.getParameterValue(lasthinPro.CLASSIFY_AS):
|
||||
commands.append("-classify_as")
|
||||
commands.append(str(self.getParameterValue(lasthinPro.CLASSIFY_AS_CLASS)))
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -41,16 +41,19 @@ class lastile(LAStoolsAlgorithm):
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParametersFilesAreFlightlinesGUI()
|
||||
self.addParametersApplyFileSourceIdGUI()
|
||||
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.REVERSIBLE, "make tiling reversible (advanced, usually not needed)", False))
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
self.addParametersFilesAreFlightlinesCommands(commands)
|
||||
self.addParametersApplyFileSourceIdCommands(commands)
|
||||
tile_size = self.getParameterValue(lastile.TILE_SIZE)
|
||||
commands.append("-tile_size")
|
||||
commands.append(str(tile_size))
|
||||
@ -61,5 +64,6 @@ class lastile(LAStoolsAlgorithm):
|
||||
if self.getParameterValue(lastile.REVERSIBLE):
|
||||
commands.append("-reversible")
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -43,6 +43,7 @@ class lastilePro(LAStoolsAlgorithm):
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersFilesAreFlightlinesGUI()
|
||||
self.addParametersApplyFileSourceIdGUI()
|
||||
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))
|
||||
@ -53,10 +54,11 @@ class lastilePro(LAStoolsAlgorithm):
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lastile")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersFilesAreFlightlinesCommands(commands)
|
||||
self.addParametersApplyFileSourceIdCommands(commands)
|
||||
tile_size = self.getParameterValue(lastilePro.TILE_SIZE)
|
||||
commands.append("-tile_size")
|
||||
commands.append(str(tile_size))
|
||||
|
@ -26,24 +26,31 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.outputs import OutputFile
|
||||
|
||||
class lasvalidate(LAStoolsAlgorithm):
|
||||
|
||||
ONE_REPORT_PER_FILE = "ONE_REPORT_PER_FILE"
|
||||
OUTPUT = "OUTPUT"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasvalidate"
|
||||
self.group = "LAStools"
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParameter(ParameterBoolean(lasvalidate.ONE_REPORT_PER_FILE, "save report to '*_LVS.xml'", False))
|
||||
self.addOutput(OutputFile(lasvalidate.OUTPUT, "Output XML file"))
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasvalidate.exe")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasvalidate")]
|
||||
self.addParametersPointInputCommands(commands)
|
||||
commands.append("-o")
|
||||
commands.append(self.getOutputValue(lasvalidate.OUTPUT))
|
||||
if self.getParameterValue(lasvalidate.ONE_REPORT_PER_FILE):
|
||||
commands.append("-oxml")
|
||||
else:
|
||||
commands.append("-o")
|
||||
commands.append(self.getOutputValue(lasvalidate.OUTPUT))
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -0,0 +1,56 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasvalidatePro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.outputs import OutputFile
|
||||
|
||||
class lasvalidatePro(LAStoolsAlgorithm):
|
||||
|
||||
ONE_REPORT_PER_FILE = "ONE_REPORT_PER_FILE"
|
||||
OUTPUT = "OUTPUT"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasvalidatePro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterBoolean(lasvalidatePro.ONE_REPORT_PER_FILE, "generate one '*_LVS.xml' report per file", False))
|
||||
self.addOutput(OutputFile(lasvalidatePro.OUTPUT, "Output XML file"))
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasvalidate")]
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
if self.getParameterValue(lasvalidatePro.ONE_REPORT_PER_FILE):
|
||||
commands.append("-oxml")
|
||||
else:
|
||||
commands.append("-o")
|
||||
commands.append(self.getOutputValue(lasvalidatePro.OUTPUT))
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -2,7 +2,7 @@
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasinfo.py
|
||||
lasview.py
|
||||
---------------------
|
||||
Date : August 2012
|
||||
Copyright : (C) 2012 by Victor Olaya
|
||||
@ -31,20 +31,42 @@ import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterNumber
|
||||
|
||||
class lasview(LAStoolsAlgorithm):
|
||||
|
||||
INPUT = "INPUT"
|
||||
OUTPUT = "OUTPUT"
|
||||
POINTS = "POINTS"
|
||||
|
||||
SIZE = "SIZE"
|
||||
SIZES = ["1024 768", "800 600", "1200 900", "1200 400", "1550 900", "1550 1150"]
|
||||
|
||||
COLORING = "COLORING"
|
||||
COLORINGS = ["default", "classification", "elevation1", "elevation2", "intensity", "return", "flightline", "rgb"]
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasview"
|
||||
self.group = "LAStools"
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParameter(ParameterNumber(lasview.POINTS, "max number of points sampled", 100000, 20000000, 5000000))
|
||||
self.addParameter(ParameterSelection(lasview.COLORING, "color by", lasview.COLORINGS, 0))
|
||||
self.addParameter(ParameterSelection(lasview.SIZE, "window size (x y) in pixels", lasview.SIZES, 0))
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasview.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasview")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
points = self.getParameterValue(lasview.POINTS)
|
||||
commands.append("-points " + str(points))
|
||||
coloring = self.getParameterValue(lasview.COLORING)
|
||||
if coloring != 0:
|
||||
commands.append("-color_by_" + lasview.COLORINGS[coloring])
|
||||
size = self.getParameterValue(lasview.SIZE)
|
||||
if size != 0:
|
||||
commands.append("-win " + lasview.SIZES[size])
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
print commands
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
70
python/plugins/processing/algs/lidar/lastools/lasviewPro.py
Normal file
70
python/plugins/processing/algs/lidar/lastools/lasviewPro.py
Normal file
@ -0,0 +1,70 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
lasviewPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterSelection
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterNumber
|
||||
|
||||
class lasviewPro(LAStoolsAlgorithm):
|
||||
|
||||
POINTS = "POINTS"
|
||||
|
||||
SIZE = "SIZE"
|
||||
SIZES = ["1024 768", "800 600", "1200 900", "1200 400", "1550 900", "1550 1150"]
|
||||
|
||||
COLORING = "COLORING"
|
||||
COLORINGS = ["default", "classification", "elevation1", "elevation2", "intensity", "return", "flightline", "rgb"]
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "lasviewPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParametersFilesAreFlightlinesGUI()
|
||||
self.addParameter(ParameterNumber(lasviewPro.POINTS, "max number of points sampled", 100000, 20000000, 5000000))
|
||||
self.addParameter(ParameterSelection(lasviewPro.COLORING, "color by", lasviewPro.COLORINGS, 0))
|
||||
self.addParameter(ParameterSelection(lasviewPro.SIZE, "window size (x y) in pixels", lasviewPro.SIZES, 0))
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasview")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
self.addParametersFilesAreFlightlinesCommands(commands)
|
||||
points = self.getParameterValue(lasviewPro.POINTS)
|
||||
commands.append("-points " + str(points))
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
coloring = self.getParameterValue(lasviewPro.COLORING)
|
||||
if coloring != 0:
|
||||
commands.append("-color_by_" + lasviewPro.COLORINGS[coloring])
|
||||
size = self.getParameterValue(lasviewPro.SIZE)
|
||||
if size != 0:
|
||||
commands.append("-win " + lasviewPro.SIZES[size])
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -32,6 +32,8 @@ from processing.core.parameters import ParameterBoolean
|
||||
class laszip(LAStoolsAlgorithm):
|
||||
|
||||
REPORT_SIZE = "REPORT_SIZE"
|
||||
CREATE_LAX = "CREATE_LAX"
|
||||
APPEND_LAX = "APPEND_LAX"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "laszip"
|
||||
@ -39,15 +41,23 @@ class laszip(LAStoolsAlgorithm):
|
||||
self.addParametersVerboseGUI()
|
||||
self.addParametersPointInputGUI()
|
||||
self.addParameter(ParameterBoolean(laszip.REPORT_SIZE, "only report size", False))
|
||||
self.addParameter(ParameterBoolean(laszip.CREATE_LAX, "create spatial indexing file (*.lax)", False))
|
||||
self.addParameter(ParameterBoolean(laszip.APPEND_LAX, "append *.lax into *.laz file", False))
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "laszip.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "laszip")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputCommands(commands)
|
||||
if self.getParameterValue(laszip.REPORT_SIZE):
|
||||
commands.append("-size")
|
||||
if self.getParameterValue(laszip.CREATE_LAX):
|
||||
commands.append("-lax")
|
||||
if self.getParameterValue(laszip.APPEND_LAX):
|
||||
commands.append("-append")
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
69
python/plugins/processing/algs/lidar/lastools/laszipPro.py
Normal file
69
python/plugins/processing/algs/lidar/lastools/laszipPro.py
Normal file
@ -0,0 +1,69 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
laszipPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
|
||||
class laszipPro(LAStoolsAlgorithm):
|
||||
|
||||
REPORT_SIZE = "REPORT_SIZE"
|
||||
CREATE_LAX = "CREATE_LAX"
|
||||
APPEND_LAX = "APPEND_LAX"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "laszipPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersPointInputFolderGUI()
|
||||
self.addParameter(ParameterBoolean(laszipPro.REPORT_SIZE, "only report size", False))
|
||||
self.addParameter(ParameterBoolean(laszipPro.CREATE_LAX, "create spatial indexing file (*.lax)", False))
|
||||
self.addParameter(ParameterBoolean(laszipPro.APPEND_LAX, "append *.lax into *.laz file", False))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "laszip")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
if self.getParameterValue(laszipPro.REPORT_SIZE):
|
||||
commands.append("-size")
|
||||
if self.getParameterValue(laszipPro.CREATE_LAX):
|
||||
commands.append("-lax")
|
||||
if self.getParameterValue(laszipPro.APPEND_LAX):
|
||||
commands.append("-append")
|
||||
self.addParametersCoresCommands(commands)
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
@ -44,9 +44,10 @@ class shp2las(LAStoolsAlgorithm):
|
||||
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()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "shp2las.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "shp2las")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
commands.append("-i")
|
||||
commands.append(self.getParameterValue(shp2las.INPUT))
|
||||
@ -56,5 +57,6 @@ class shp2las(LAStoolsAlgorithm):
|
||||
commands.append("-set_scale_factor")
|
||||
commands.append(str(scale_factor_xy) + " " + str(scale_factor_xy) + " " + str(scale_factor_z))
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
las2txt.py
|
||||
txt2las.py
|
||||
---------------------
|
||||
Date : September 2013
|
||||
Copyright : (C) 2013 by Martin Isenburg
|
||||
@ -30,34 +30,49 @@ from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
from processing.core.parameters import ParameterNumber
|
||||
from processing.core.parameters import ParameterString
|
||||
from processing.core.parameters import ParameterFile
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
class txt2las(LAStoolsAlgorithm):
|
||||
|
||||
INPUT = "INPUT"
|
||||
PARSE_STRING = "PARSE_STRING"
|
||||
PARSE = "PARSE"
|
||||
SKIP = "SKIP"
|
||||
SCALE_FACTOR_XY = "SCALE_FACTOR_XY"
|
||||
SCALE_FACTOR_Z = "SCALE_FACTOR_Z"
|
||||
|
||||
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", "ecef"]
|
||||
|
||||
PROJECTION = "PROJECTION"
|
||||
UTM = "UTM"
|
||||
SP = "SP"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
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(ParameterString(txt2las.PARSE, "parse lines as", "xyz"))
|
||||
self.addParameter(ParameterNumber(txt2las.SKIP, "skip the first n lines", 0, None, 0))
|
||||
self.addParameter(ParameterNumber(txt2las.SCALE_FACTOR_XY, "resolution of x and y coordinate", 0, None, 0.01))
|
||||
self.addParameter(ParameterNumber(txt2las.SCALE_FACTOR_Z, "resolution of z coordinate", 0, None, 0.01))
|
||||
self.addParameter(ParameterSelection(txt2las.PROJECTION, "projection", txt2las.PROJECTIONS, 0))
|
||||
self.addParameter(ParameterSelection(txt2las.UTM, "utm zone", txt2las.UTM_ZONES, 0))
|
||||
self.addParameter(ParameterSelection(txt2las.SP, "state plane code", txt2las.STATE_PLANES, 0))
|
||||
self.addParametersPointOutputGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "txt2las.exe")]
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "txt2las")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
commands.append("-i")
|
||||
commands.append(self.getParameterValue(txt2las.INPUT))
|
||||
parse_string = self.getParameterValue(txt2las.PARSE_STRING)
|
||||
parse_string = self.getParameterValue(txt2las.PARSE)
|
||||
if parse_string != "xyz":
|
||||
commands.append("-parse_string")
|
||||
commands.append("-parse")
|
||||
commands.append(parse_string)
|
||||
skip = self.getParameterValue(txt2las.SKIP)
|
||||
if parse_string != 0:
|
||||
@ -66,8 +81,26 @@ class txt2las(LAStoolsAlgorithm):
|
||||
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("-set_scale")
|
||||
commands.append(str(scale_factor_xy) + " " + str(scale_factor_xy) + " " + str(scale_factor_z))
|
||||
projection = self.getParameterValue(txt2las.PROJECTION)
|
||||
if projection != 0:
|
||||
if projection == 1:
|
||||
utm_zone = self.getParameterValue(txt2las.UTM)
|
||||
if utm_zone != 0:
|
||||
commands.append("-" + txt2las.PROJECTIONS[projection])
|
||||
if utm_zone > 60:
|
||||
commands.append(str(utm_zone - 60) + "M")
|
||||
else:
|
||||
commands.append(str(utm_zone) + "N")
|
||||
elif projection < 4:
|
||||
sp_code = self.getParameterValue(txt2las.SP)
|
||||
if sp_code != 0:
|
||||
commands.append("-" + txt2las.PROJECTIONS[projection])
|
||||
commands.append(txt2las.STATE_PLANES[sp_code])
|
||||
else:
|
||||
commands.append("-" + txt2las.PROJECTIONS[projection])
|
||||
self.addParametersPointOutputCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
||||
|
109
python/plugins/processing/algs/lidar/lastools/txt2lasPro.py
Normal file
109
python/plugins/processing/algs/lidar/lastools/txt2lasPro.py
Normal file
@ -0,0 +1,109 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
txt2lasPro.py
|
||||
---------------------
|
||||
Date : October 2014
|
||||
Copyright : (C) 2014 by Martin Isenburg
|
||||
Email : martin near rapidlasso point com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Martin Isenburg'
|
||||
__date__ = 'October 2014'
|
||||
__copyright__ = '(C) 2014, Martin Isenburg'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from LAStoolsUtils import LAStoolsUtils
|
||||
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
||||
|
||||
from processing.core.parameters import ParameterNumber
|
||||
from processing.core.parameters import ParameterString
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
class txt2lasPro(LAStoolsAlgorithm):
|
||||
|
||||
PARSE = "PARSE"
|
||||
SKIP = "SKIP"
|
||||
SCALE_FACTOR_XY = "SCALE_FACTOR_XY"
|
||||
SCALE_FACTOR_Z = "SCALE_FACTOR_Z"
|
||||
|
||||
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", "ecef"]
|
||||
|
||||
PROJECTION = "PROJECTION"
|
||||
UTM = "UTM"
|
||||
SP = "SP"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = "txt2lasPro"
|
||||
self.group = "LAStools Production"
|
||||
self.addParametersGenericInputFolderGUI("*.txt")
|
||||
self.addParameter(ParameterString(txt2lasPro.PARSE, "parse lines as", "xyz"))
|
||||
self.addParameter(ParameterNumber(txt2lasPro.SKIP, "skip the first n lines", 0, None, 0))
|
||||
self.addParameter(ParameterNumber(txt2lasPro.SCALE_FACTOR_XY, "resolution of x and y coordinate", 0, None, 0.01))
|
||||
self.addParameter(ParameterNumber(txt2lasPro.SCALE_FACTOR_Z, "resolution of z coordinate", 0, None, 0.01))
|
||||
self.addParameter(ParameterSelection(txt2lasPro.PROJECTION, "projection", txt2lasPro.PROJECTIONS, 0))
|
||||
self.addParameter(ParameterSelection(txt2lasPro.UTM, "utm zone", txt2lasPro.UTM_ZONES, 0))
|
||||
self.addParameter(ParameterSelection(txt2lasPro.SP, "state plane code", txt2lasPro.STATE_PLANES, 0))
|
||||
self.addParametersOutputDirectoryGUI()
|
||||
self.addParametersOutputAppendixGUI()
|
||||
self.addParametersPointOutputFormatGUI()
|
||||
self.addParametersAdditionalGUI()
|
||||
self.addParametersCoresGUI()
|
||||
self.addParametersVerboseGUI()
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "txt2las")]
|
||||
self.addParametersVerboseCommands(commands)
|
||||
self.addParametersPointInputFolderCommands(commands)
|
||||
parse_string = self.getParameterValue(txt2lasPro.PARSE)
|
||||
if parse_string != "xyz":
|
||||
commands.append("-parse")
|
||||
commands.append(parse_string)
|
||||
skip = self.getParameterValue(txt2lasPro.SKIP)
|
||||
if parse_string != 0:
|
||||
commands.append("-skip")
|
||||
commands.append(str(skip))
|
||||
scale_factor_xy = self.getParameterValue(txt2lasPro.SCALE_FACTOR_XY)
|
||||
scale_factor_z = self.getParameterValue(txt2lasPro.SCALE_FACTOR_Z)
|
||||
if scale_factor_xy != 0.01 or scale_factor_z != 0.01:
|
||||
commands.append("-set_scale")
|
||||
commands.append(str(scale_factor_xy) + " " + str(scale_factor_xy) + " " + str(scale_factor_z))
|
||||
projection = self.getParameterValue(txt2lasPro.PROJECTION)
|
||||
if projection != 0:
|
||||
if projection == 1:
|
||||
utm_zone = self.getParameterValue(txt2lasPro.UTM)
|
||||
if utm_zone != 0:
|
||||
commands.append("-" + txt2lasPro.PROJECTIONS[projection])
|
||||
if utm_zone > 60:
|
||||
commands.append(str(utm_zone - 60) + "M")
|
||||
else:
|
||||
commands.append(str(utm_zone) + "N")
|
||||
elif projection < 4:
|
||||
sp_code = self.getParameterValue(txt2lasPro.SP)
|
||||
if sp_code != 0:
|
||||
commands.append("-" + txt2lasPro.PROJECTIONS[projection])
|
||||
commands.append(txt2lasPro.STATE_PLANES[sp_code])
|
||||
else:
|
||||
commands.append("-" + txt2lasPro.PROJECTIONS[projection])
|
||||
self.addParametersOutputDirectoryCommands(commands)
|
||||
self.addParametersOutputAppendixCommands(commands)
|
||||
self.addParametersPointOutputFormatCommands(commands)
|
||||
self.addParametersAdditionalCommands(commands)
|
||||
self.addParametersCoresCommands(commands)
|
||||
|
||||
LAStoolsUtils.runLAStools(commands, progress)
|
Loading…
x
Reference in New Issue
Block a user