@@ -101,9 +101,9 @@ def defineCharacteristics(self):
101
101
self .addParameter (ParameterSelection (self .BIGTIFF ,
102
102
self .tr ('Control whether the created file is a BigTIFF or a classic TIFF' ), self .BIGTIFFTYPE , 0 ))
103
103
self .addParameter (ParameterBoolean (self .TFW ,
104
- self .tr ('Force the generation of an associated ESRI world file (.tfw)) ' ), False ))
104
+ self .tr ('Force the generation of an associated ESRI world file (.tfw)' ), False ))
105
105
self .addOutput (OutputRaster (self .OUTPUT ,
106
- self .tr ('Output layer: mandatory to choose an existing raster layer if the (*) option is selected' )))
106
+ self .tr ('Output layer: mandatory if the (*) option is selected' )))
107
107
108
108
def processAlgorithm (self , progress ):
109
109
writeOver = self .getParameterValue (self .WRITEOVER )
@@ -127,19 +127,21 @@ def processAlgorithm(self, progress):
127
127
arguments .append ('-ot' )
128
128
arguments .append (self .TYPE [self .getParameterValue (self .RTYPE )])
129
129
dimType = self .getParameterValue (self .DIMENSIONS )
130
- if dimType == 0 :
131
- # size in pixels
132
- arguments .append ('-ts' )
133
- arguments .append (str (self .getParameterValue (self .WIDTH )))
134
- arguments .append (str (self .getParameterValue (self .HEIGHT )))
135
- else :
136
- # resolution in map units per pixel
137
- arguments .append ('-tr' )
138
- arguments .append (str (self .getParameterValue (self .WIDTH )))
139
- arguments .append (str (self .getParameterValue (self .HEIGHT )))
140
- if len (noData ) > 0 :
141
- arguments .append ('-a_nodata' )
142
- arguments .append (noData )
130
+ if not writeOver :
131
+ if dimType == 0 :
132
+ # size in pixels
133
+ arguments .append ('-ts' )
134
+ arguments .append (str (self .getParameterValue (self .WIDTH )))
135
+ arguments .append (str (self .getParameterValue (self .HEIGHT )))
136
+ else :
137
+ # resolution in map units per pixel
138
+ arguments .append ('-tr' )
139
+ arguments .append (str (self .getParameterValue (self .WIDTH )))
140
+ arguments .append (str (self .getParameterValue (self .HEIGHT )))
141
+ if not writeOver :
142
+ if len (noData ) > 0 :
143
+ arguments .append ('-a_nodata' )
144
+ arguments .append (noData )
143
145
if (GdalUtils .getFormatShortNameFromFilename (out ) == "GTiff" ) and (writeOver is False ):
144
146
arguments .append ("-co COMPRESS=" + compress )
145
147
if compress == 'JPEG' :
0 commit comments