Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 92ec118
Showing
3 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |