-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed #5450 started added FUSION lidar tools git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@159 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
- Loading branch information
volayaf
committed
Apr 27, 2012
1 parent
4e62f7c
commit ebf7d1e
Showing
21 changed files
with
170 additions
and
25 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
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
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,34 @@ | ||
import os | ||
from sextante.parameters.ParameterFile import ParameterFile | ||
from sextante.outputs.OutputTable import OutputTable | ||
from sextante.core.GeoAlgorithm import GeoAlgorithm | ||
from sextante.fusion.FusionUtils import FusionUtils | ||
from PyQt4 import QtGui | ||
|
||
class CloudMetrics(GeoAlgorithm): | ||
|
||
INPUT = "INPUT" | ||
OUTPUT = "OUTPUT" | ||
|
||
def getIcon(self): | ||
return QtGui.QIcon(os.path.dirname(__file__) + "/../images/tool.png") | ||
|
||
def defineCharacteristics(self): | ||
self.name = "Cloud Metrics" | ||
self.group = "Tools" | ||
self.addParameter(ParameterFile(self.INPUT, "Input las layer")) | ||
self.addOutput(OutputTable(self.OUTPUT, "Output file with tabular metric information")) | ||
#self.addCommonParameters() | ||
|
||
def processAlgorithm(self, progress): | ||
commands = [os.path.join(FusionUtils.FusionPath(), "CloudMetrics.exe")] | ||
files = self.getParameterValue(self.INPUT).split(";") | ||
if len(files) == 1: | ||
commands.append(self.getParameterValue(self.INPUT)) | ||
else: | ||
FusionUtils.createFileList(files) | ||
commands.append(FusionUtils.tempFileListFilepath()) | ||
commands.append(self.getOutputValue(self.OUTPUT)) | ||
#self.addCommonParameterValuesToCommand(commands) | ||
|
||
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,35 @@ | ||
import os | ||
from PyQt4.QtCore import * | ||
from PyQt4.QtGui import * | ||
from sextante.core.AlgorithmProvider import AlgorithmProvider | ||
from sextante.core.SextanteConfig import Setting, SextanteConfig | ||
from sextante.fusion.FusionUtils import FusionUtils | ||
from sextante.fusion.OpenViewerAction import OpenViewerAction | ||
from sextante.fusion.CloudMetrics import CloudMetrics | ||
|
||
|
||
class FusionAlgorithmProvider(AlgorithmProvider): | ||
|
||
def __init__(self): | ||
AlgorithmProvider.__init__(self) | ||
self.actions.append(OpenViewerAction()) | ||
self.algsList = [(CloudMetrics())] | ||
|
||
def initializeSettings(self): | ||
AlgorithmProvider.initializeSettings(self) | ||
SextanteConfig.addSetting(Setting(self.getDescription(), FusionUtils.FUSION_FOLDER, "Fusion folder", FusionUtils.FusionPath())) | ||
|
||
def getName(self): | ||
return "fusion" | ||
|
||
def getDescription(self): | ||
return "FUSION (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"] |
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,41 @@ | ||
from PyQt4.QtCore import * | ||
from PyQt4.QtGui import * | ||
import subprocess | ||
from sextante.core.SextanteLog import SextanteLog | ||
from sextante.core.SextanteConfig import SextanteConfig | ||
import os | ||
from sextante.core.SextanteUtils import SextanteUtils | ||
|
||
class FusionUtils(): | ||
|
||
FUSION_FOLDER = "FUSION_FOLDER" | ||
|
||
@staticmethod | ||
def FusionPath(): | ||
folder = SextanteConfig.getSetting(FusionUtils.FUSION_FOLDER) | ||
if folder == None: | ||
folder ="" | ||
|
||
return folder | ||
|
||
@staticmethod | ||
def tempFileListFilepath(): | ||
filename = "fusion_files_list.txt"; | ||
filepath = SextanteUtils.userFolder() + os.sep + filename | ||
return filepath | ||
|
||
@staticmethod | ||
def createFileList(files): | ||
out = open(FusionUtils.tempFileListFilepath(), "w") | ||
for f in files: | ||
out.write(f) | ||
out.close() | ||
|
||
@staticmethod | ||
def runFusion(commands, progress): | ||
loglines = [] | ||
loglines.append("Fusion execution console output") | ||
proc = subprocess.Popen(commands, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE,stderr=subprocess.STDOUT, universal_newlines=False).stdout | ||
for line in iter(proc.readline, ""): | ||
loglines.append(line) | ||
SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines) |
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,21 @@ | ||
from sextante.gui.ToolboxAction import ToolboxAction | ||
import os | ||
from PyQt4 import QtGui | ||
from sextante.fusion.FusionUtils import FusionUtils | ||
import subprocess | ||
|
||
class OpenViewerAction(ToolboxAction): | ||
|
||
def __init__(self): | ||
self.name="Open LAS viewer" | ||
self.group="Visualization" | ||
|
||
def getIcon(self): | ||
return QtGui.QIcon(os.path.dirname(__file__) + "/../images/tool.png") | ||
|
||
def execute(self): | ||
f = os.path.join(FusionUtils.FusionPath(), "pdq.exe") | ||
if os.path.exists(f): | ||
subprocess.Popen(f) | ||
else: | ||
QtGui.QMessageBox.critical(None, "Unable to open viewer", "The current Fusion folder does not contain the viewer executable.\nPlease check the configuration in the SEXTANTE settings dialog.") |
Empty file.
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
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
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
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
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
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