Skip to content
Permalink
Browse files
added GridSurface and MergeData algs to FUSION
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@180 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf committed May 10, 2012
1 parent 3e77423 commit 92ec1188d443a49fbc9b72a078754876b54b8221
Showing with 83 additions and 2 deletions.
  1. +6 −2 src/sextante/fusion/FusionAlgorithmProvider.py
  2. +46 −0 src/sextante/fusion/GridSurfaceCreate.py
  3. +31 −0 src/sextante/fusion/MergeData.py
@@ -13,18 +13,22 @@
from sextante.fusion.FilterData import FilterData
from sextante.fusion.GridMetrics import GridMetrics
from sextante.fusion.GroundFilter import GroundFilter
from sextante.fusion.GridSurfaceCreate import GridSurfaceCreate
from sextante.fusion.MergeData import MergeData


class FusionAlgorithmProvider(AlgorithmProvider):

def __init__(self):
AlgorithmProvider.__init__(self)
self.actions.append(OpenViewerAction())
self.algsList = [CloudMetrics(), CanopyMaxima(), CanopyModel(), ClipData(), Cover(), FilterData(), GridMetrics(), GroundFilter()]
self.algsList = [CloudMetrics(), CanopyMaxima(), CanopyModel(), ClipData(), Cover(), FilterData(),
GridMetrics(), GroundFilter(), GridSurfaceCreate(), MergeData()]

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

def getName(self):
return "fusion"
@@ -0,0 +1,46 @@
import os
from sextante.parameters.ParameterFile import ParameterFile
from sextante.fusion.FusionUtils import FusionUtils
from sextante.parameters.ParameterNumber import ParameterNumber
from sextante.outputs.OutputRaster import OutputRaster
from sextante.parameters.ParameterSelection import ParameterSelection
from sextante.fusion.FusionAlgorithm import FusionAlgorithm

class GridSurfaceCreate(FusionAlgorithm):

INPUT = "INPUT"
OUTPUT = "OUTPUT"
CELLSIZE = "CELLSIZE"
XYUNITS = "XYUNITS"
ZUNITS = "ZUNITS"
UNITS = ["Meter", "Feet"]

def defineCharacteristics(self):
self.name = "Create Grid Surface"
self.group = "Surface"
self.addParameter(ParameterFile(self.INPUT, "Input las layer"))
self.addParameter(ParameterNumber(self.CELLSIZE, "Cellsize", 0, None, 10.0))
self.addParameter(ParameterSelection(self.XYUNITS, "XY Units", self.UNITS))
self.addParameter(ParameterSelection(self.ZUNITS, "Z Units", self.UNITS))
self.addOutput(OutputRaster(self.OUTPUT, "PLANS DTM surface"))
self.addAdvancedModifiers()

def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), "GridSurfaceCreate.exe")]
commands.append("/verbose")
self.addAdvancedModifiersToCommand(commands)
commands.append(self.getOutputValue(self.OUTPUT))
commands.append(str(self.getParameterValue(self.CELLSIZE)))
commands.append(self.UNITS[self.getParameterValue(self.XYUNITS)][0])
commands.append(self.UNITS[self.getParameterValue(self.ZUNITS)][0])
commands.append("0")
commands.append("0")
commands.append("0")
commands.append("0")
files = self.getParameterValue(self.INPUT).split(";")
if len(files) == 1:
commands.append(self.getParameterValue(self.INPUT))
else:
FusionUtils.createFileList(files)
commands.append(FusionUtils.tempFileListFilepath())
FusionUtils.runFusion(commands, progress)
@@ -0,0 +1,31 @@
import os
from sextante.parameters.ParameterFile import ParameterFile
from sextante.fusion.FusionUtils import FusionUtils
from sextante.outputs.OutputFile import OutputFile
from sextante.fusion.FusionAlgorithm import FusionAlgorithm

class MergeData(FusionAlgorithm):

INPUT = "INPUT"
OUTPUT = "OUTPUT"


def defineCharacteristics(self):
self.name = "Merge LAS Files"
self.group = "Points"
self.addParameter(ParameterFile(self.INPUT, "Input LAS files"))
self.addOutput(OutputFile(self.OUTPUT, "Output merged LAS file"))

def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), "MergeData.exe")]
commands.append("/verbose")
self.addAdvancedModifiersToCommand(commands)
files = self.getParameterValue(self.INPUT).split(";")
if len(files) == 1:
commands.append(self.getParameterValue(self.INPUT))
else:
FusionUtils.createFileList(files)
commands.append(FusionUtils.tempFileListFilepath())
outFile = self.getOutputValue(self.OUTPUT)
commands.append(outFile)
FusionUtils.runFusion(commands, progress)

0 comments on commit 92ec118

Please sign in to comment.