2013-09-24 22:06:50 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
"""
|
|
|
|
***************************************************************************
|
|
|
|
lasmerge.py
|
|
|
|
---------------------
|
|
|
|
Date : September 2013
|
|
|
|
Copyright : (C) 2013 by Martin Isenburg
|
|
|
|
Email : martin near rapidlasso point com
|
|
|
|
***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************
|
|
|
|
"""
|
|
|
|
|
|
|
|
__author__ = 'Martin Isenburg'
|
|
|
|
__date__ = 'September 2013'
|
|
|
|
__copyright__ = '(C) 2013, Martin Isenburg'
|
|
|
|
# This will get replaced with a git SHA1 when you do a git archive
|
|
|
|
__revision__ = '$Format:%H$'
|
|
|
|
|
|
|
|
import os
|
2014-04-17 01:41:25 +02:00
|
|
|
from LAStoolsUtils import LAStoolsUtils
|
|
|
|
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
2013-09-24 22:06:50 +02:00
|
|
|
|
2014-07-14 14:19:09 +02:00
|
|
|
from processing.core.parameters import ParameterFile
|
2013-09-24 22:06:50 +02:00
|
|
|
|
|
|
|
class lasmerge(LAStoolsAlgorithm):
|
|
|
|
|
2014-05-19 19:58:33 +02:00
|
|
|
FILE2 = "FILE2"
|
|
|
|
FILE3 = "FILE3"
|
|
|
|
FILE4 = "FILE4"
|
|
|
|
FILE5 = "FILE5"
|
|
|
|
FILE6 = "FILE6"
|
|
|
|
FILE7 = "FILE7"
|
2013-09-24 22:06:50 +02:00
|
|
|
|
|
|
|
def defineCharacteristics(self):
|
2014-05-19 19:58:33 +02:00
|
|
|
self.name = "lasmerge"
|
|
|
|
self.group = "LAStools"
|
2013-09-24 22:06:50 +02:00
|
|
|
self.addParametersVerboseGUI()
|
|
|
|
self.addParametersFilesAreFlightlinesGUI()
|
2014-12-22 12:32:37 +01:00
|
|
|
self.addParametersApplyFileSourceIdGUI()
|
2013-09-24 22:06:50 +02:00
|
|
|
self.addParametersPointInputGUI()
|
2015-01-14 20:57:56 +02:00
|
|
|
self.addParameter(ParameterFile(lasmerge.FILE2, self.tr("2nd file")))
|
|
|
|
self.addParameter(ParameterFile(lasmerge.FILE3, self.tr("3rd file")))
|
|
|
|
self.addParameter(ParameterFile(lasmerge.FILE4, self.tr("4th file")))
|
|
|
|
self.addParameter(ParameterFile(lasmerge.FILE5, self.tr("5th file")))
|
|
|
|
self.addParameter(ParameterFile(lasmerge.FILE6, self.tr("6th file")))
|
|
|
|
self.addParameter(ParameterFile(lasmerge.FILE7, self.tr("7th file")))
|
2013-09-24 22:06:50 +02:00
|
|
|
self.addParametersPointOutputGUI()
|
2014-12-22 12:32:37 +01:00
|
|
|
self.addParametersAdditionalGUI()
|
2014-05-19 19:58:33 +02:00
|
|
|
|
2013-09-24 22:06:50 +02:00
|
|
|
def processAlgorithm(self, progress):
|
2014-12-22 12:32:37 +01:00
|
|
|
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasmerge")]
|
2013-09-24 22:06:50 +02:00
|
|
|
self.addParametersVerboseCommands(commands)
|
|
|
|
self.addParametersPointInputCommands(commands)
|
|
|
|
file2 = self.getParameterValue(lasmerge.FILE2)
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
if file2 is not None:
|
2014-05-19 19:58:33 +02:00
|
|
|
commands.append("-i")
|
2013-09-24 22:06:50 +02:00
|
|
|
commands.append(file2)
|
|
|
|
file3 = self.getParameterValue(lasmerge.FILE3)
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
if file3 is not None:
|
2014-05-19 19:58:33 +02:00
|
|
|
commands.append("-i")
|
2013-09-24 22:06:50 +02:00
|
|
|
commands.append(file3)
|
|
|
|
file4 = self.getParameterValue(lasmerge.FILE4)
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
if file4 is not None:
|
2014-05-19 19:58:33 +02:00
|
|
|
commands.append("-i")
|
2013-09-24 22:06:50 +02:00
|
|
|
commands.append(file4)
|
|
|
|
file5 = self.getParameterValue(lasmerge.FILE5)
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
if file5 is not None:
|
2014-05-19 19:58:33 +02:00
|
|
|
commands.append("-i")
|
2013-09-24 22:06:50 +02:00
|
|
|
commands.append(file5)
|
|
|
|
file6 = self.getParameterValue(lasmerge.FILE6)
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
if file6 is not None:
|
2014-05-19 19:58:33 +02:00
|
|
|
commands.append("-i")
|
2013-09-24 22:06:50 +02:00
|
|
|
commands.append(file6)
|
|
|
|
file7 = self.getParameterValue(lasmerge.FILE7)
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
if file7 is not None:
|
2014-05-19 19:58:33 +02:00
|
|
|
commands.append("-i")
|
2013-09-24 22:06:50 +02:00
|
|
|
commands.append(file7)
|
2014-12-22 12:32:37 +01:00
|
|
|
self.addParametersFilesAreFlightlinesCommands(commands)
|
|
|
|
self.addParametersApplyFileSourceIdsCommands(commands)
|
2013-09-24 22:06:50 +02:00
|
|
|
self.addParametersPointOutputCommands(commands)
|
2014-12-22 12:32:37 +01:00
|
|
|
self.addParametersAdditionalCommands(commands)
|
2014-05-21 21:25:18 +02:00
|
|
|
|
2013-09-24 22:06:50 +02:00
|
|
|
LAStoolsUtils.runLAStools(commands, progress)
|