Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 24663d5

Browse files
committedMar 28, 2019
[processing] Refine check for usable layers
- allow WMS layers and other non-GDAL raster layers. This will work fine for native algorithms, likely not work for other providers. They will need to be adapted to throw errors when incompatible raster layer providers are used - invalid layers are not permitted (e.g. those with missing data sources)
1 parent f5a3485 commit 24663d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/processing/qgsprocessingutils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,12 @@ bool QgsProcessingUtils::canUseLayer( const QgsMeshLayer *layer )
368368
bool QgsProcessingUtils::canUseLayer( const QgsRasterLayer *layer )
369369
{
370370
// only gdal file-based layers
371-
return layer && layer->providerType() == QStringLiteral( "gdal" );
371+
return layer && layer->isValid();
372372
}
373373

374374
bool QgsProcessingUtils::canUseLayer( const QgsVectorLayer *layer, const QList<int> &sourceTypes )
375375
{
376-
return layer &&
376+
return layer && layer->isValid() &&
377377
( sourceTypes.isEmpty()
378378
|| ( sourceTypes.contains( QgsProcessing::TypeVectorPoint ) && layer->geometryType() == QgsWkbTypes::PointGeometry )
379379
|| ( sourceTypes.contains( QgsProcessing::TypeVectorLine ) && layer->geometryType() == QgsWkbTypes::LineGeometry )

0 commit comments

Comments
 (0)
Please sign in to comment.