Skip to content

Commit 491ca33

Browse files
DelazJnyalldawson
authored andcommittedMay 19, 2019
Make data type option translatable in GDAL algorithms dialog
1 parent 83cbe24 commit 491ca33

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed
 

‎python/plugins/processing/algs/gdal/ClipRasterByExtent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ class ClipRasterByExtent(GdalAlgorithm):
5050
DATA_TYPE = 'DATA_TYPE'
5151
OUTPUT = 'OUTPUT'
5252

53-
TYPES = ['Use input layer data type', 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
54-
5553
def __init__(self):
5654
super().__init__()
5755

5856
def initAlgorithm(self, config=None):
57+
58+
self.TYPES = [self.tr('Use Input Layer Data Type'), 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
59+
5960
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT,
6061
self.tr('Input layer')))
6162
self.addParameter(QgsProcessingParameterExtent(self.EXTENT,

‎python/plugins/processing/algs/gdal/ClipRasterByMask.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ class ClipRasterByMask(GdalAlgorithm):
6161
MULTITHREADING = 'MULTITHREADING'
6262
OUTPUT = 'OUTPUT'
6363

64-
TYPES = ['Use input layer data type', 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
65-
6664
def __init__(self):
6765
super().__init__()
6866

6967
def initAlgorithm(self, config=None):
68+
69+
self.TYPES = [self.tr('Use Input Layer Data Type'), 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
70+
7071
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT,
7172
self.tr('Input layer')))
7273
self.addParameter(QgsProcessingParameterFeatureSource(self.MASK,

‎python/plugins/processing/algs/gdal/rearrange_bands.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ class rearrange_bands(GdalAlgorithm):
4848
DATA_TYPE = 'DATA_TYPE'
4949
OUTPUT = 'OUTPUT'
5050

51-
TYPES = ['Use input layer data type', 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
52-
5351
def __init__(self):
5452
super().__init__()
5553

5654
def initAlgorithm(self, config=None):
55+
56+
self.TYPES = [self.tr('Use Input Layer Data Type'), 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
57+
5758
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
5859
self.addParameter(QgsProcessingParameterBand(self.BANDS,
5960
self.tr('Selected band(s)'),

‎python/plugins/processing/algs/gdal/translate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ class translate(GdalAlgorithm):
5151
DATA_TYPE = 'DATA_TYPE'
5252
OUTPUT = 'OUTPUT'
5353

54-
TYPES = ['Use input layer data type', 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
55-
5654
def __init__(self):
5755
super().__init__()
5856

5957
def initAlgorithm(self, config=None):
58+
59+
self.TYPES = [self.tr('Use Input Layer Data Type'), 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
60+
6061
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
6162
self.addParameter(QgsProcessingParameterCrs(self.TARGET_CRS,
6263
self.tr('Override the projection for the output file'),

‎python/plugins/processing/algs/gdal/warp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ class warp(GdalAlgorithm):
5959
EXTRA = 'EXTRA'
6060
OUTPUT = 'OUTPUT'
6161

62-
TYPES = ['Use input layer data type', 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
63-
6462
def __init__(self):
6563
super().__init__()
6664

@@ -78,6 +76,8 @@ def initAlgorithm(self, config=None):
7876
(self.tr('First quartile'), 'q1'),
7977
(self.tr('Third quartile'), 'q3'))
8078

79+
self.TYPES = [self.tr('Use Input Layer Data Type'), 'Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64', 'CInt16', 'CInt32', 'CFloat32', 'CFloat64']
80+
8181
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
8282
self.addParameter(QgsProcessingParameterCrs(self.SOURCE_CRS,
8383
self.tr('Source CRS'),

0 commit comments

Comments
 (0)
Please sign in to comment.