mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-09 00:35:20 -05:00
63 lines
2.3 KiB
Python
63 lines
2.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
***************************************************************************
|
|
lassplit.py
|
|
---------------------
|
|
Date : August 2012
|
|
Copyright : (C) 2012 by Victor Olaya
|
|
Email : volayaf at gmail dot com
|
|
---------------------
|
|
Date : September 2013
|
|
Copyright : (C) 2013 by Martin Isenburg
|
|
Email : martin near rapidlasso point com
|
|
***************************************************************************
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
***************************************************************************
|
|
"""
|
|
|
|
__author__ = 'Victor Olaya'
|
|
__date__ = 'August 2012'
|
|
__copyright__ = '(C) 2012, Victor Olaya'
|
|
|
|
# This will get replaced with a git SHA1 when you do a git archive
|
|
|
|
__revision__ = '$Format:%H$'
|
|
|
|
import os
|
|
from LAStoolsUtils import LAStoolsUtils
|
|
from LAStoolsAlgorithm import LAStoolsAlgorithm
|
|
|
|
from processing.parameters.ParameterNumber import ParameterNumber
|
|
|
|
|
|
class lassplit(LAStoolsAlgorithm):
|
|
|
|
NUM_POINTS = 'NUM_POINTS'
|
|
|
|
def defineCharacteristics(self):
|
|
self.name = 'lassplit'
|
|
self.group = 'LAStools'
|
|
self.addParametersVerboseGUI()
|
|
self.addParametersPointInputGUI()
|
|
self.addParameter(ParameterNumber(lassplit.NUM_POINTS,
|
|
'number of points in output files', 1, None,
|
|
1000000))
|
|
self.addParametersPointOutputGUI()
|
|
|
|
def processAlgorithm(self, progress):
|
|
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), 'bin',
|
|
'lassplit.exe')]
|
|
self.addParametersVerboseCommands(commands)
|
|
self.addParametersPointInputCommands(commands)
|
|
commands.append('-split')
|
|
commands.append(self.getParameterValue(lassplit.NUM_POINTS))
|
|
self.addParametersPointOutputCommands(commands)
|
|
|
|
LAStoolsUtils.runLAStools(commands, progress)
|