@@ -52,17 +52,18 @@ def __init__(self):
52
52
53
53
def initAlgorithm (self , config = None ):
54
54
self .addParameter (QgsProcessingParameterRasterLayer (
55
- self .INPUT ,
56
- self .tr ('Input file' )))
55
+ self .INPUT ,
56
+ self .tr ('Input file' )))
57
57
self .addParameter (QgsProcessingParameterBoolean (
58
- self .PRJ_FILE_CREATE ,
59
- self .tr ('Create also .prj file' ), False ))
60
- self .addOutput (QgsProcessingOutputFile (self .WORLD_FILE ,
61
- self .tr ('World file' )))
58
+ self .PRJ_FILE_CREATE ,
59
+ self .tr ('Create also .prj file' ), False ))
62
60
self .addOutput (QgsProcessingOutputFile (
63
- self .PRJ_FILE ,
64
- self .tr ('ESRI Shapefile prj file' )))
65
-
61
+ self .WORLD_FILE ,
62
+ self .tr ('World file' )))
63
+ self .addOutput (QgsProcessingOutputFile (
64
+ self .PRJ_FILE ,
65
+ self .tr ('ESRI Shapefile prj file' )))
66
+
66
67
def name (self ):
67
68
return 'extractprojection'
68
69
@@ -93,7 +94,7 @@ def processAlgorithm(self, parameters, context, feedback):
93
94
raster = self .parameterAsRasterLayer (parameters , self .INPUT ,
94
95
context )
95
96
if not raster .dataProvider ().name () == 'gdal' :
96
- raise QgsProcessingException ('This algorithm can only ' \
97
+ raise QgsProcessingException ('This algorithm can only '
97
98
'be used with GDAL raster layers' )
98
99
rasterPath = raster .source ()
99
100
rasterDS = gdal .Open (rasterPath , gdal .GA_ReadOnly )
@@ -116,7 +117,7 @@ def processAlgorithm(self, parameters, context, feedback):
116
117
with open (outFileName + '.prj' , 'wt' ) as prj :
117
118
prj .write (crs )
118
119
results [self .PRJ_FILE ] = outFileName + '.prj'
119
- else :
120
+ else :
120
121
results [self .PRJ_FILE ] = None
121
122
122
123
with open (outFileName + '.wld' , 'wt' ) as wld :
0 commit comments