Skip to content

Commit

Permalink
reorganized lidar tools
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@242 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf@gmail.com committed Jun 14, 2012
1 parent 1fd5368 commit 9f7013a
Show file tree
Hide file tree
Showing 39 changed files with 98 additions and 68 deletions.
13 changes: 6 additions & 7 deletions src/sextante/core/Sextante.py
Expand Up @@ -23,6 +23,7 @@
from sextante.fusion.FusionAlgorithmProvider import FusionAlgorithmProvider
from sextante.pymorph.PymorphAlgorithmProvider import PymorphAlgorithmProvider
from sextante.mmqgisx.MMQGISXAlgorithmProvider import MMQGISXAlgorithmProvider
from sextante.lidar.LidarToolsAlgorithmProvider import LidarToolsAlgorithmProvider

class Sextante:

Expand Down Expand Up @@ -89,9 +90,7 @@ def initialize():
Sextante.addProvider(ModelerOnlyAlgorithmProvider())
Sextante.addProvider(GdalAlgorithmProvider())
Sextante.addProvider(PymorphAlgorithmProvider())
Sextante.addProvider(LasToolsAlgorithmProvider())
if SextanteUtils.isWindows():
Sextante.addProvider(FusionAlgorithmProvider())
Sextante.addProvider(LidarToolsAlgorithmProvider())
Sextante.addProvider(OTBAlgorithmProvider())
Sextante.addProvider(RAlgorithmProvider())
Sextante.addProvider(SagaAlgorithmProvider())
Expand Down Expand Up @@ -316,7 +315,7 @@ def runandload(name, *args):
Sextante.alghelp(name)
return

alg = alg.getCopy()#copy.deepcopy(alg)
alg = alg.getCopy()
i = 0
for param in alg.parameters:
if not param.setValue(args[i]):
Expand All @@ -343,12 +342,12 @@ def finish():
QApplication.restoreOverrideCursor()
def error(msg):
QApplication.restoreOverrideCursor()
QMessageBox.critical(self, "Error", msg)
QMessageBox.critical(None, "Error", msg)
SextanteLog.addToLog(SextanteLog.LOG_ERROR, msg)
algEx.error.connect(error)
algEx.finished.connect(finish)
algEx.start()




4 changes: 2 additions & 2 deletions src/sextante/gui/AlgorithmExecutor.py
Expand Up @@ -57,9 +57,9 @@ def runalg(self):
# if self.algorithm.canceled:
# self.canceled.emit()
#===================================================================
except GeoAlgorithmExecutionException as e :
except GeoAlgorithmExecutionException,e :
self.error.emit(e.msg)
except BaseException as e:
except BaseException,e:
self.error.emit(str(e))

def runalgIterating(self):
Expand Down
9 changes: 5 additions & 4 deletions src/sextante/gui/BatchProcessingDialog.py
Expand Up @@ -16,6 +16,7 @@
from sextante.outputs.OutputHTML import OutputHTML
from sextante.core.SextanteResults import SextanteResults
from sextante.gui.ResultsDialog import ResultsDialog
from sextante.core.SextanteLog import SextanteLog

class BatchProcessingDialog(QtGui.QDialog):
def __init__(self, alg):
Expand Down Expand Up @@ -101,9 +102,9 @@ def okPressed(self):
self.progress.setMaximum(len(self.algs))
self.progress.setValue(0)
self.nextAlg(0)

self.table.setEnabled(False)

def loadHTMLResults(self, alg, i):
for out in alg.outputs:
if out.hidden or not out.open:
Expand Down Expand Up @@ -131,13 +132,13 @@ def error(self, msg):
QMessageBox.critical(self, "Error", msg)
SextanteLog.addToLog(SextanteLog.LOG_ERROR, msg)
self.close()

def nextAlg(self, i):
self.algEx = AlgorithmExecutor(self.algs[i]);
self.algEx.error.connect(self.error)
self.algEx.finished.connect(lambda: self.finish(i))
self.algEx.start()

def finishAll(self):
i = 0
for alg in self.algs:
Expand Down
5 changes: 3 additions & 2 deletions src/sextante/gui/ParametersDialog.py
Expand Up @@ -161,6 +161,7 @@ def accept(self):
QMessageBox.critical(self.dialog, "Unable to execute algorithm", msg)
return
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(False)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(False)
buttons = self.paramTable.iterateButtons
iterateParam = None

Expand Down Expand Up @@ -193,15 +194,14 @@ def accept(self):
def finish(self):
self.dialog.executed = True
QApplication.restoreOverrideCursor()

keepOpen = SextanteConfig.getSetting(SextanteConfig.KEEP_DIALOG_OPEN)

if not keepOpen:
self.dialog.close()
else:
self.progressLabel.setText("")
self.progress.setValue(0)
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)
SextantePostprocessing.handleAlgorithmResults(self.alg, not keepOpen)

Expand All @@ -211,6 +211,7 @@ def error(self, msg):
QApplication.restoreOverrideCursor()
QMessageBox.critical(self, "Error", msg)
SextanteLog.addToLog(SextanteLog.LOG_ERROR, msg)
keepOpen = SextanteConfig.getSetting(SextanteConfig.KEEP_DIALOG_OPEN)
if not keepOpen:
self.dialog.close()
else:
Expand Down
46 changes: 0 additions & 46 deletions src/sextante/lastools/LasToolsAlgorithmProvider.py

This file was deleted.

75 changes: 75 additions & 0 deletions src/sextante/lidar/LidarToolsAlgorithmProvider.py
@@ -0,0 +1,75 @@
import os
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from sextante.core.AlgorithmProvider import AlgorithmProvider
from sextante.core.SextanteUtils import SextanteUtils
from sextante.lidar.lastools.LasToolsUtils import LasToolsUtils
from sextante.core.SextanteConfig import Setting, SextanteConfig
from sextante.lidar.lastools.las2dem import las2dem
from sextante.lidar.lastools.las2iso import las2iso
from sextante.lidar.lastools.las2shp import las2shp
from sextante.lidar.lastools.lasboundary import lasboundary
from sextante.lidar.lastools.lasgrid import lasgrid
from sextante.lidar.lastools.lasground import lasground
from sextante.lidar.lastools.lasclassify import lasclassify
from sextante.lidar.lastools.lasclip import lasclip
from sextante.lidar.lastools.lasheight import lasheight
from sextante.lidar.lastools.lasinfo import lasinfo
from sextante.lidar.lastools.lasprecision import lasprecision
from sextante.lidar.lastools.lassplit import lassplit
from sextante.lidar.fusion.OpenViewerAction import OpenViewerAction
from sextante.lidar.fusion.CanopyMaxima import CanopyMaxima
from sextante.lidar.fusion.CanopyModel import CanopyModel
from sextante.lidar.fusion.ClipData import ClipData
from sextante.lidar.fusion.CloudMetrics import CloudMetrics
from sextante.lidar.fusion.Cover import Cover
from sextante.lidar.fusion.GridMetrics import GridMetrics
from sextante.lidar.fusion.GridSurfaceCreate import GridSurfaceCreate
from sextante.lidar.fusion.GroundFilter import GroundFilter
from sextante.lidar.fusion.MergeData import MergeData
from sextante.lidar.fusion.FilterData import FilterData
from sextante.lidar.fusion.FusionUtils import FusionUtils


class LidarToolsAlgorithmProvider(AlgorithmProvider):

def __init__(self):
AlgorithmProvider.__init__(self)
self.algsList = []
if SextanteUtils.isWindows():
lastools = [las2shp(), lasboundary(), las2dem(), las2iso(), lasgrid(), lasground(),
lasinfo(), lasheight(), lasprecision(), lassplit(), lasclassify(), lasclip()]
else:
self.lastools = [lasinfo(), lasprecision()]
for alg in lastools:
alg.group = "LASTools"
self.algsList.extend(lastools)

if SextanteUtils.isWindows():
self.actions.append(OpenViewerAction())
fusiontools = [CloudMetrics(), CanopyMaxima(), CanopyModel(), ClipData(), Cover(), FilterData(),
GridMetrics(), GroundFilter(), GridSurfaceCreate(), MergeData()]
for alg in fusiontools:
alg.group = "Fusion"
self.algsList.extend(fusiontools)

def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)
SextanteConfig.addSetting(Setting(self.getDescription(), LasToolsUtils.LASTOOLS_FOLDER, "LASTools folder", LasToolsUtils.LasToolsPath()))
SextanteConfig.addSetting(Setting(self.getDescription(), FusionUtils.FUSION_FOLDER, "Fusion folder",
FusionUtils.FusionPath()))

def getName(self):
return "lidartools"

def getDescription(self):
return "Tools for LiDAR data"

def getIcon(self):
return QIcon(os.path.dirname(__file__) + "/../images/tool.png")

def _loadAlgorithms(self):
self.algs = self.algsList

def getSupportedOutputTableExtensions(self):
return ["csv"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions src/sextante/saga/description/ReclassifyGridValues.txt
Expand Up @@ -2,17 +2,17 @@ Reclassify Grid Values
grid_tools
ParameterRaster|INPUT|Grid|False
ParameterSelection|METHOD|Method|[0] single;[1] range;[2] simple table
ParameterNumber|OLD|old value (for single value change)|None|None|0
ParameterNumber|NEW|new value (for single value change)|None|None|1
ParameterNumber|OLD|old value (for single value change)|None|None|0.0
ParameterNumber|NEW|new value (for single value change)|None|None|1.0
ParameterSelection|SOPERATOR|operator (for single value change)|[0] =;[1] <;[2] <=;[3] >=;[4] >
ParameterNumber|MIN|minimum value (for range)|None|None|0
ParameterNumber|MAX|maximum value (for range)|None|None|1
ParameterNumber|RNEW|new value(for range)|None|None|2
ParameterNumber|MIN|minimum value (for range)|None|None|0.0
ParameterNumber|MAX|maximum value (for range)|None|None|1.0
ParameterNumber|RNEW|new value(for range)|None|None|2.0
ParameterSelection|ROPERATOR|operator (for range)|[0] <=;[1] <
ParameterFixedTable|RETAB|Lookup Table|3|minimum;maximum;new|False
ParameterSelection|TOPERATOR|operator (for table)|[0] min <= value < max;[1] min <= value <= max;[2] min < value <= max;[3] min < value < max
ParameterBoolean|NODATAOPT |replace no data values|True
ParameterNumber|NODATA|new value for no data values|None|None|0
ParameterNumber|NODATA|new value for no data values|None|None|0.0
ParameterBoolean|OTHEROPT |replace other values|True
ParameterNumber|OTHERS|new value for other values|None|None|0
ParameterNumber|OTHERS|new value for other values|None|None|0.0
OutputRaster|RESULT|Reclassified Grid

0 comments on commit 9f7013a

Please sign in to comment.