@@ -118,39 +118,6 @@ def getParameterValues(self):
118
118
119
119
return self .algorithm ().preprocessParameters (parameters )
120
120
121
- def checkExtentCRS (self ):
122
- unmatchingCRS = False
123
- hasExtent = False
124
- context = dataobjects .createContext ()
125
- projectCRS = iface .mapCanvas ().mapSettings ().destinationCrs ()
126
- layers = QgsProcessingUtils .compatibleLayers (QgsProject .instance ())
127
- for param in self .algorithm ().parameterDefinitions ():
128
- if isinstance (param , (ParameterRaster , ParameterVector , ParameterMultipleInput )):
129
- if param .value :
130
- if isinstance (param , ParameterMultipleInput ):
131
- inputlayers = param .value .split (';' )
132
- else :
133
- inputlayers = [param .value ]
134
- for inputlayer in inputlayers :
135
- for layer in layers :
136
- if layer .source () == inputlayer :
137
- if layer .crs () != projectCRS :
138
- unmatchingCRS = True
139
-
140
- p = QgsProcessingUtils .mapLayerFromString (inputlayer , context )
141
- if p is not None :
142
- if p .crs () != projectCRS :
143
- unmatchingCRS = True
144
- if isinstance (param , ParameterExtent ):
145
- if param .skip_crs_check :
146
- continue
147
-
148
- value = self .mainWidget ().wrappers [param .name ()].widget .leText .text ().strip ()
149
- if value :
150
- hasExtent = True
151
-
152
- return hasExtent and unmatchingCRS
153
-
154
121
def accept (self ):
155
122
feedback = self .createFeedback ()
156
123
context = dataobjects .createContext (feedback )
@@ -161,25 +128,13 @@ def accept(self):
161
128
162
129
if checkCRS and not self .algorithm ().validateInputCrs (parameters , context ):
163
130
reply = QMessageBox .question (self , self .tr ("Unmatching CRS's" ),
164
- self .tr ('Layers do not all use the same CRS. This can '
131
+ self .tr ('Parameters do not all use the same CRS. This can '
165
132
'cause unexpected results.\n Do you want to '
166
133
'continue?' ),
167
134
QMessageBox .Yes | QMessageBox .No ,
168
135
QMessageBox .No )
169
136
if reply == QMessageBox .No :
170
137
return
171
- checkExtentCRS = ProcessingConfig .getSetting (ProcessingConfig .WARN_UNMATCHING_EXTENT_CRS )
172
- # TODO
173
- if False and checkExtentCRS and self .checkExtentCRS ():
174
- reply = QMessageBox .question (self , self .tr ("Extent CRS" ),
175
- self .tr ('Extent parameters must use the same CRS as the input layers.\n '
176
- 'Your input layers do not have the same extent as the project, '
177
- 'so the extent might be in a wrong CRS if you have selected it from the canvas.\n '
178
- 'Do you want to continue?' ),
179
- QMessageBox .Yes | QMessageBox .No ,
180
- QMessageBox .No )
181
- if reply == QMessageBox .No :
182
- return
183
138
ok , msg = self .algorithm ().checkParameterValues (parameters , context )
184
139
if msg :
185
140
QMessageBox .warning (
0 commit comments