Skip to content

Commit

Permalink
fixes bugs about processing evolution
Browse files Browse the repository at this point in the history
  • Loading branch information
amondot committed Jan 31, 2014
1 parent 4f443dd commit 7abca16
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 40 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/otb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB DESCR_FILES description/*.txt)
FILE(GLOB DESCR_FILES description/*.xml)
FILE(GLOB HELPER_FILES helper/*.py)
FiLE(GLOB HELP_FILES description/doc/*.html)

Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/otb/OTBAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
from processing.parameters.ParameterSelection import ParameterSelection
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.ProcessingLog import ProcessingLog
from processing.core.ProcessingUtils import ProcessingUtils
from processing.core.WrongHelpFileException import WrongHelpFileException
from processing.parameters.ParameterFactory import ParameterFactory
from processing.outputs.OutputFactory import OutputFactory
from processing.otb.OTBUtils import OTBUtils
from processing.parameters.ParameterExtent import ParameterExtent
from processing.tools.system import *
import xml.etree.ElementTree as ET
import traceback
import inspect
Expand Down Expand Up @@ -250,15 +250,15 @@ def processAlgorithm(self, progress):
if isinstance(param, ParameterVector):
commands.append(param.name)
if self.hasROI:
roiFile = ProcessingUtils.getTempFilename('shp')
roiFile = getTempFilename('shp')
commands.append(roiFile)
self.roiVectors[param.value] = roiFile
else:
commands.append("\"" + param.value+ "\"")
elif isinstance(param, ParameterRaster):
commands.append(param.name)
if self.hasROI:
roiFile = ProcessingUtils.getTempFilename('tif')
roiFile = getTempFilename('tif')
commands.append(roiFile)
self.roiRasters[param.value] = roiFile
else:
Expand Down
11 changes: 5 additions & 6 deletions python/plugins/processing/otb/OTBUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@
import subprocess
from processing.core.ProcessingConfig import ProcessingConfig
from processing.core.ProcessingLog import ProcessingLog
from processing.core.ProcessingUtils import ProcessingUtils
from processing.tools.system import *
import logging
import xml.etree.ElementTree as ET
import traceback
from processing.core.QGisLayers import QGisLayers
import qgis.core
import PyQt4.QtGui

Expand All @@ -56,15 +55,15 @@ def otbPath():
if folder == None:
folder = ""
#try to configure the path automatically
if ProcessingUtils.isMac():
if isMac():
testfolder = os.path.join(str(QgsApplication.prefixPath()), "bin")
if os.path.exists(os.path.join(testfolder, "otbcli")):
folder = testfolder
else:
testfolder = "/usr/local/bin"
if os.path.exists(os.path.join(testfolder, "otbcli")):
folder = testfolder
elif ProcessingUtils.isWindows():
elif isWindows():
testfolder = os.path.dirname(str(QgsApplication.prefixPath()))
testfolder = os.path.dirname(testfolder)
testfolder = os.path.join(testfolder, "bin")
Expand All @@ -83,15 +82,15 @@ def otbLibPath():
if folder == None:
folder =""
#try to configure the path automatically
if ProcessingUtils.isMac():
if isMac():
testfolder = os.path.join(str(QgsApplication.prefixPath()), "lib/otb/applications")
if os.path.exists(testfolder):
folder = testfolder
else:
testfolder = "/usr/local/lib/otb/applications"
if os.path.exists(testfolder):
folder = testfolder
elif ProcessingUtils.isWindows():
elif isWindows():
testfolder = os.path.dirname(str(QgsApplication.prefixPath()))
testfolder = os.path.join(testfolder, "orfeotoolbox")
testfolder = os.path.join(testfolder, "applications")
Expand Down
30 changes: 0 additions & 30 deletions python/plugins/processing/otb/description/SplitImage.xml

This file was deleted.

0 comments on commit 7abca16

Please sign in to comment.