Skip to content

Commit

Permalink
[processing] Fix sort order of output raster extensions list
Browse files Browse the repository at this point in the history
to make it easier to find the extension in the long list of available extensions in the "Save to File" window of the GDAL provider algorithms
  • Loading branch information
agiudiceandrea committed Feb 25, 2021
1 parent 91c8b23 commit d43245c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions python/plugins/processing/algs/gdal/GdalUtils.py
Expand Up @@ -170,8 +170,8 @@ def getSupportedRasters():

GdalUtils.supportedRasters = {}
GdalUtils.supportedOutputRasters = {}
GdalUtils.supportedRasters['GTiff'] = ['tif']
GdalUtils.supportedOutputRasters['GTiff'] = ['tif']
GdalUtils.supportedRasters['GTiff'] = ['tif', 'tiff']
GdalUtils.supportedOutputRasters['GTiff'] = ['tif', 'tiff']

for i in range(gdal.GetDriverCount()):
driver = gdal.GetDriver(i)
Expand Down Expand Up @@ -210,20 +210,24 @@ def getSupportedOutputRasters():

@staticmethod
def getSupportedRasterExtensions():
allexts = ['tif']
allexts = []
for exts in list(GdalUtils.getSupportedRasters().values()):
for ext in exts:
if ext not in allexts and ext != '':
if ext not in allexts and ext not in ['', 'tif', 'tiff']:
allexts.append(ext)
allexts.sort()
allexts[0:0] = ['tif', 'tiff']
return allexts

@staticmethod
def getSupportedOutputRasterExtensions():
allexts = ['tif']
allexts = []
for exts in list(GdalUtils.getSupportedOutputRasters().values()):
for ext in exts:
if ext not in allexts and ext != '':
if ext not in allexts and ext not in ['', 'tif', 'tiff']:
allexts.append(ext)
allexts.sort()
allexts[0:0] = ['tif', 'tiff']
return allexts

@staticmethod
Expand Down

0 comments on commit d43245c

Please sign in to comment.