Skip to content
Permalink
Browse files

Report missing spatial index as warning instead of error

  • Loading branch information
uclaros authored and nyalldawson committed Mar 30, 2021
1 parent 71fd493 commit f466f42761ddcb2a39e6e0be6368472e6343712a
@@ -112,7 +112,7 @@ void QgsLocationBasedAlgorithm::processByIteratingOverTargetSource( const QgsPro
QgsProcessingFeedback *feedback )
{
if ( intersectSource->hasSpatialIndex() == QgsFeatureSource::SpatialIndexNotPresent )
feedback->reportError( QObject::tr( "No spatial index exists for intersect layer, performance will be severely degraded" ) );
feedback->pushWarning( QObject::tr( "No spatial index exists for intersect layer, performance will be severely degraded" ) );

QgsFeatureIds foundSet;
QgsFeatureRequest request = QgsFeatureRequest();
@@ -369,7 +369,7 @@ void QgsJoinByLocationAlgorithm::processAlgorithmByIteratingOverJoinedSource( Qg
void QgsJoinByLocationAlgorithm::processAlgorithmByIteratingOverInputSource( QgsProcessingContext &context, QgsProcessingFeedback *feedback )
{
if ( mJoinSource->hasSpatialIndex() == QgsFeatureSource::SpatialIndexNotPresent )
feedback->reportError( QObject::tr( "No spatial index exists for join layer, performance will be severely degraded" ) );
feedback->pushWarning( QObject::tr( "No spatial index exists for join layer, performance will be severely degraded" ) );

QgsFeatureIterator it = mBaseSource->getFeatures();
QgsFeature f;
@@ -163,7 +163,7 @@ bool QgsPointsInPolygonAlgorithm::prepareAlgorithm( const QVariantMap &parameter
}

if ( mPointSource->hasSpatialIndex() == QgsFeatureSource::SpatialIndexNotPresent )
feedback->reportError( QObject::tr( "No spatial index exists for points layer, performance will be severely degraded" ) );
feedback->pushWarning( QObject::tr( "No spatial index exists for points layer, performance will be severely degraded" ) );

return true;
}
@@ -138,7 +138,7 @@ bool QgsSumLineLengthAlgorithm::prepareAlgorithm( const QVariantMap &parameters,
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "LINES" ) ) );

if ( mLinesSource->hasSpatialIndex() == QgsFeatureSource::SpatialIndexNotPresent )
feedback->reportError( QObject::tr( "No spatial index exists for lines layer, performance will be severely degraded" ) );
feedback->pushWarning( QObject::tr( "No spatial index exists for lines layer, performance will be severely degraded" ) );

mDa.setEllipsoid( context.ellipsoid() );
mTransformContext = context.transformContext();

0 comments on commit f466f42

Please sign in to comment.