Skip to content
Permalink
Browse files

Fix vector file formats show in processing options for raster output

extension (fix #16894)
  • Loading branch information
nyalldawson committed Jul 26, 2017
1 parent a95cbe9 commit a48c1469165b487d0e9dfd9bf4dcac44158911c5
Showing with 9 additions and 3 deletions.
  1. +9 −3 python/plugins/processing/algs/gdal/GdalUtils.py
@@ -45,13 +45,13 @@

try:
from osgeo import gdal # NOQA

gdalAvailable = True
except:
gdalAvailable = False


class GdalUtils(object):

GDAL_HELP_PATH = 'GDAL_HELP_PATH'

supportedRasters = None
@@ -106,7 +106,9 @@ def runGdal(commands, feedback=None):
if retry_count < 5:
retry_count += 1
else:
raise IOError(e.message + u'\nTried 5 times without success. Last iteration stopped after reading {} line(s).\nLast line(s):\n{}'.format(len(loglines), u'\n'.join(loglines[-10:])))
raise IOError(
e.message + u'\nTried 5 times without success. Last iteration stopped after reading {} line(s).\nLast line(s):\n{}'.format(
len(loglines), u'\n'.join(loglines[-10:])))

QgsMessageLog.logMessage('\n'.join(loglines), 'Processing', QgsMessageLog.INFO)
GdalUtils.consoleOutput = loglines
@@ -134,6 +136,10 @@ def getSupportedRasters():
continue
shortName = driver.ShortName
metadata = driver.GetMetadata()
if gdal.DCAP_RASTER not in metadata \
or metadata[gdal.DCAP_RASTER] != 'YES':
continue

# ===================================================================
# if gdal.DCAP_CREATE not in metadata \
# or metadata[gdal.DCAP_CREATE] != 'YES':
@@ -183,7 +189,7 @@ def escapeAndJoin(strList):
for s in strList:
if s and s[0] != '-' and ' ' in s:
escaped = '"' + s.replace('\\', '\\\\').replace('"', '\\"') \
+ '"'
+ '"'
else:
escaped = s
joined += escaped + ' '

0 comments on commit a48c146

Please sign in to comment.
You can’t perform that action at this time.