def processAlgorithm(self, progress): commands = [os.path.join(FusionUtils.FusionPath(), "CanopyModel.exe")] commands.append("/verbose") self.addAdvancedModifiersToCommand(commands) ground = self.getParameterValue(self.GROUND) if str(ground).strip() != "": commands.append("/ground:" + str(ground)) outFile = self.getOutputValue(self.OUTPUT)+".dtm" commands.append(outFile) 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) commands = [os.path.join(FusionUtils.FusionPath(), "DTM2TIF.exe")] commands.append(outFile) commands.append(self.getOutputValue(self.OUTPUT)) p = subprocess.Popen(commands, shell=True) p.wait()
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)
def processAlgorithm(self, progress): commands = [os.path.join(FusionUtils.FusionPath(), "GridMetrics.exe")] commands.append("/verbose") self.addAdvancedModifiersToCommand(commands) commands.append(self.getParameterValue(self.GROUND)) commands.append(str(self.getParameterValue(self.HEIGHT))) commands.append(str(self.getParameterValue(self.CELLSIZE))) commands.append(self.getOutputValue(self.OUTPUT)) 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)
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 processAlgorithm(self, progress): commands = [os.path.join(FusionUtils.FusionPath(), "Cover.exe")] commands.append("/verbose") self.addAdvancedModifiersToCommand(commands) ground = self.getParameterValue(self.GROUND) if str(ground).strip() != "": commands.append("/ground:" + str(ground)) outFile = self.getOutputValue(self.OUTPUT)+".dtm" commands.append(outFile) 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) commands = [os.path.join(FusionUtils.FusionPath(), "DTM2TIF.exe")] commands.append(outFile) commands.append(self.getOutputValue(self.OUTPUT)) p = subprocess.Popen(commands, shell=True) p.wait()
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." )
def processAlgorithm(self, progress): commands = [os.path.join(FusionUtils.FusionPath(), "GroundFilter.exe")] commands.append("/verbose") self.addAdvancedModifiersToCommand(commands) outFile = self.getOutputValue(self.OUTPUT) + ".lda" commands.append(str(self.getParameterValue(self.CELLSIZE))) commands.append(outFile) 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) commands = [os.path.join(FusionUtils.FusionPath(), "LDA2LAS.exe")] commands.append(outFile) commands.append(self.getOutputValue(self.OUTPUT)) p = subprocess.Popen(commands, shell=True) p.wait()
def processAlgorithm(self, progress): commands = [os.path.join(FusionUtils.FusionPath(), "FilterData.exe")] commands.append("/verbose") self.addAdvancedModifiersToCommand(commands) commands.append("/shape:" + str(self.getParameterValue(self.SHAPE))) 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) + ".lda" commands.append(outFile) extent = str(self.getParameterValue(self.EXTENT)).split(",") commands.append(extent[0]) commands.append(extent[2]) commands.append(extent[1]) commands.append(extent[3]) FusionUtils.runFusion(commands, progress) commands = [os.path.join(FusionUtils.FusionPath(), "LDA2LAS.exe")] commands.append(outFile) commands.append(self.getOutputValue(self.OUTPUT)) p = subprocess.Popen(commands, shell=True) p.wait()
def processAlgorithm(self, progress): commands = [os.path.join(FusionUtils.FusionPath(), "CanopyMaxima.exe")] commands.append("/verbose") self.addAdvancedModifiersToCommand(commands) ground = self.getParameterValue(self.GROUND) if str(ground).strip() != "": commands.append("/ground:" + str(ground)) commands.append("/threshold:" + str(self.getParameterValue(self.THRESHOLD))) 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)) FusionUtils.runFusion(commands, progress)
def checkBeforeOpeningParametersDialog(self): path = FusionUtils.FusionPath() if path == "": return "Fusion folder is not configured.\nPlease configure it before running Fusion algorithms."