mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
commit
b68ee3d8f9
@ -81,7 +81,7 @@ class OTBAlgorithm(GeoAlgorithm):
|
|||||||
folder = OTBUtils.compatibleDescriptionPath(version)
|
folder = OTBUtils.compatibleDescriptionPath(version)
|
||||||
if folder is None:
|
if folder is None:
|
||||||
return False, None
|
return False, None
|
||||||
folder = os.path.join(folder, 'doc')
|
folder = os.path.join(folder, 'doc')
|
||||||
helpfile = os.path.join(unicode(folder), self.appkey + ".html")
|
helpfile = os.path.join(unicode(folder), self.appkey + ".html")
|
||||||
if os.path.exists(helpfile):
|
if os.path.exists(helpfile):
|
||||||
return False, helpfile
|
return False, helpfile
|
||||||
|
@ -67,11 +67,9 @@ class OTBAlgorithmProvider(AlgorithmProvider):
|
|||||||
folder = OTBUtils.compatibleDescriptionPath(version)
|
folder = OTBUtils.compatibleDescriptionPath(version)
|
||||||
if folder is None:
|
if folder is None:
|
||||||
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
|
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
|
||||||
self.tr('Problem with OTB installation: installed OTB version (%s) is not supported' % version))
|
self.tr('Problem with OTB installation: installed OTB version (%s) is not supported' % version))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for descriptionFile in os.listdir(folder):
|
for descriptionFile in os.listdir(folder):
|
||||||
if descriptionFile.endswith("xml"):
|
if descriptionFile.endswith("xml"):
|
||||||
try:
|
try:
|
||||||
@ -111,4 +109,3 @@ class OTBAlgorithmProvider(AlgorithmProvider):
|
|||||||
AlgorithmProvider.unload(self)
|
AlgorithmProvider.unload(self)
|
||||||
ProcessingConfig.removeSetting(OTBUtils.OTB_FOLDER)
|
ProcessingConfig.removeSetting(OTBUtils.OTB_FOLDER)
|
||||||
ProcessingConfig.removeSetting(OTBUtils.OTB_LIB_FOLDER)
|
ProcessingConfig.removeSetting(OTBUtils.OTB_LIB_FOLDER)
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ def getInstalledVersion(runOtb=False):
|
|||||||
if _installedVersionFound and not runOtb:
|
if _installedVersionFound and not runOtb:
|
||||||
return _installedVersion
|
return _installedVersion
|
||||||
|
|
||||||
commands =[os.path.join(otbPath(), "otbcli_Smoothing")]
|
commands = [os.path.join(otbPath(), "otbcli_Smoothing")]
|
||||||
progress = SilentProgress()
|
progress = SilentProgress()
|
||||||
out = executeOtb(commands, progress, False)
|
out = executeOtb(commands, progress, False)
|
||||||
for line in out:
|
for line in out:
|
||||||
@ -145,6 +145,7 @@ def getInstalledVersion(runOtb=False):
|
|||||||
break
|
break
|
||||||
return _installedVersion
|
return _installedVersion
|
||||||
|
|
||||||
|
|
||||||
def compatibleDescriptionPath(version):
|
def compatibleDescriptionPath(version):
|
||||||
supportedVersions = {"5.0.0": "5.0.0"}
|
supportedVersions = {"5.0.0": "5.0.0"}
|
||||||
if version is None:
|
if version is None:
|
||||||
@ -158,7 +159,8 @@ def compatibleDescriptionPath(version):
|
|||||||
|
|
||||||
return os.path.join(otbDescriptionPath(), supportedVersions[version])
|
return os.path.join(otbDescriptionPath(), supportedVersions[version])
|
||||||
|
|
||||||
def executeOtb(commands, progress, addToLog = True):
|
|
||||||
|
def executeOtb(commands, progress, addToLog=True):
|
||||||
loglines = []
|
loglines = []
|
||||||
loglines.append(tr("OTB execution console output"))
|
loglines.append(tr("OTB execution console output"))
|
||||||
os.putenv('ITK_AUTOLOAD_PATH', otbLibPath())
|
os.putenv('ITK_AUTOLOAD_PATH', otbLibPath())
|
||||||
|
@ -29,4 +29,4 @@ for i, feat in enumerate(feats):
|
|||||||
counts[clazz] += 1
|
counts[clazz] += 1
|
||||||
|
|
||||||
for c in counts:
|
for c in counts:
|
||||||
writer.addRecord(list(c) + [counts[c]])
|
writer.addRecord(list(c) + [counts[c]])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user