@@ -167,7 +167,7 @@ bool QgsProcessingAlgorithm::validateInputCrs( const QVariantMap ¶meters, Qg
167
167
QgsCoordinateReferenceSystem crs;
168
168
Q_FOREACH ( const QgsProcessingParameterDefinition *def, mParameters )
169
169
{
170
- if ( def->type () == QStringLiteral ( " layer " ) || def->type () == QStringLiteral ( " raster " ) )
170
+ if ( def->type () == QgsProcessingParameterMapLayer::typeName ( ) || def->type () == QgsProcessingParameterRasterLayer::typeName ( ) )
171
171
{
172
172
QgsMapLayer *layer = QgsProcessingParameters::parameterAsLayer ( def, parameters, context );
173
173
if ( layer )
@@ -183,7 +183,7 @@ bool QgsProcessingAlgorithm::validateInputCrs( const QVariantMap ¶meters, Qg
183
183
}
184
184
}
185
185
}
186
- else if ( def->type () == QStringLiteral ( " source " ) )
186
+ else if ( def->type () == QgsProcessingParameterFeatureSource::typeName ( ) )
187
187
{
188
188
std::unique_ptr< QgsFeatureSource > source ( QgsProcessingParameters::parameterAsSource ( def, parameters, context ) );
189
189
if ( source )
@@ -199,7 +199,7 @@ bool QgsProcessingAlgorithm::validateInputCrs( const QVariantMap ¶meters, Qg
199
199
}
200
200
}
201
201
}
202
- else if ( def->type () == QStringLiteral ( " multilayer " ) )
202
+ else if ( def->type () == QgsProcessingParameterMultipleLayers::typeName ( ) )
203
203
{
204
204
QList< QgsMapLayer *> layers = QgsProcessingParameters::parameterAsLayerList ( def, parameters, context );
205
205
Q_FOREACH ( QgsMapLayer *layer, layers )
@@ -218,6 +218,32 @@ bool QgsProcessingAlgorithm::validateInputCrs( const QVariantMap ¶meters, Qg
218
218
}
219
219
}
220
220
}
221
+ else if ( def->type () == QgsProcessingParameterExtent::typeName () )
222
+ {
223
+ QgsCoordinateReferenceSystem extentCrs = QgsProcessingParameters::parameterAsExtentCrs ( def, parameters, context );
224
+ if ( foundCrs && extentCrs.isValid () && crs != extentCrs )
225
+ {
226
+ return false ;
227
+ }
228
+ else if ( !foundCrs && extentCrs.isValid () )
229
+ {
230
+ foundCrs = true ;
231
+ crs = extentCrs;
232
+ }
233
+ }
234
+ else if ( def->type () == QgsProcessingParameterPoint::typeName () )
235
+ {
236
+ QgsCoordinateReferenceSystem pointCrs = QgsProcessingParameters::parameterAsPointCrs ( def, parameters, context );
237
+ if ( foundCrs && pointCrs.isValid () && crs != pointCrs )
238
+ {
239
+ return false ;
240
+ }
241
+ else if ( !foundCrs && pointCrs.isValid () )
242
+ {
243
+ foundCrs = true ;
244
+ crs = pointCrs;
245
+ }
246
+ }
221
247
}
222
248
return true ;
223
249
}
0 commit comments