Skip to content
Permalink
Browse files

reorganized lidar tools

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
volayaf@gmail.com committed Jun 14, 2012
1 parent 1fd5368 commit 9f7013a07597052b7f865e8c810fdb4071764729
Showing with 98 additions and 68 deletions.
  1. +6 −7 src/sextante/core/Sextante.py
  2. +2 −2 src/sextante/gui/AlgorithmExecutor.py
  3. +5 −4 src/sextante/gui/BatchProcessingDialog.py
  4. +3 −2 src/sextante/gui/ParametersDialog.py
  5. +0 −46 src/sextante/lastools/LasToolsAlgorithmProvider.py
  6. +75 −0 src/sextante/lidar/LidarToolsAlgorithmProvider.py
  7. 0 src/sextante/{fusion → lidar}/__init__.py
  8. 0 src/sextante/{ → lidar}/fusion/CanopyMaxima.py
  9. 0 src/sextante/{ → lidar}/fusion/CanopyModel.py
  10. 0 src/sextante/{ → lidar}/fusion/ClipData.py
  11. 0 src/sextante/{ → lidar}/fusion/CloudMetrics.py
  12. 0 src/sextante/{ → lidar}/fusion/Cover.py
  13. 0 src/sextante/{ → lidar}/fusion/DensityMetrics.py
  14. 0 src/sextante/{ → lidar}/fusion/FilterData.py
  15. 0 src/sextante/{ → lidar}/fusion/FusionAlgorithm.py
  16. 0 src/sextante/{ → lidar}/fusion/FusionAlgorithmProvider.py
  17. 0 src/sextante/{ → lidar}/fusion/FusionUtils.py
  18. 0 src/sextante/{ → lidar}/fusion/GridMetrics.py
  19. 0 src/sextante/{ → lidar}/fusion/GridSurfaceCreate.py
  20. 0 src/sextante/{ → lidar}/fusion/GroundFilter.py
  21. 0 src/sextante/{ → lidar}/fusion/MergeData.py
  22. 0 src/sextante/{ → lidar}/fusion/OpenViewerAction.py
  23. 0 src/sextante/{lastools → lidar/fusion}/__init__.py
  24. 0 src/sextante/{ → lidar}/lastools/LasToolsAlgorithm.py
  25. 0 src/sextante/{ → lidar}/lastools/LasToolsUtils.py
  26. 0 src/sextante/lidar/lastools/__init__.py
  27. 0 src/sextante/{ → lidar}/lastools/las2dem.py
  28. 0 src/sextante/{ → lidar}/lastools/las2iso.py
  29. 0 src/sextante/{ → lidar}/lastools/las2shp.py
  30. 0 src/sextante/{ → lidar}/lastools/lasboundary.py
  31. 0 src/sextante/{ → lidar}/lastools/lasclassify.py
  32. 0 src/sextante/{ → lidar}/lastools/lasclip.py
  33. 0 src/sextante/{ → lidar}/lastools/lasgrid.py
  34. 0 src/sextante/{ → lidar}/lastools/lasground.py
  35. 0 src/sextante/{ → lidar}/lastools/lasheight.py
  36. 0 src/sextante/{ → lidar}/lastools/lasinfo.py
  37. 0 src/sextante/{ → lidar}/lastools/lasprecision.py
  38. 0 src/sextante/{ → lidar}/lastools/lassplit.py
  39. +7 −7 src/sextante/saga/description/ReclassifyGridValues.txt
@@ -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:

@@ -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())
@@ -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]):
@@ -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()




@@ -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):
@@ -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):
@@ -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:
@@ -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:
@@ -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

@@ -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)

@@ -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:

This file was deleted.

@@ -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.
No 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.
@@ -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.
You can’t perform that action at this time.