mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
[processing] Show some more warnings when spatial indexes are missing but desirable
This commit is contained in:
parent
8cbafe7a44
commit
fd19167c0a
@ -35,6 +35,7 @@ from qgis.core import (NULL,
|
||||
QgsFeatureSink,
|
||||
QgsFeatureRequest,
|
||||
QgsGeometry,
|
||||
QgsFeatureSource,
|
||||
QgsCoordinateTransform,
|
||||
QgsStatisticalSummary,
|
||||
QgsDateTimeStatisticalSummary,
|
||||
@ -160,6 +161,9 @@ class SpatialJoinSummary(QgisAlgorithm):
|
||||
if join_source is None:
|
||||
raise QgsProcessingException(self.invalidSourceError(parameters, self.JOIN))
|
||||
|
||||
if join_source.hasSpatialIndex() == QgsFeatureSource.SpatialIndexNotPresent:
|
||||
feedback.reportError(self.tr("No spatial index exists for join layer, performance will be severely degraded"))
|
||||
|
||||
join_fields = self.parameterAsFields(parameters, self.JOIN_FIELDS, context)
|
||||
discard_nomatch = self.parameterAsBoolean(parameters, self.DISCARD_NONMATCHING, context)
|
||||
summaries = [self.statistics[i][0] for i in
|
||||
|
@ -96,6 +96,9 @@ QVariantMap QgsClipAlgorithm::processAlgorithm( const QVariantMap ¶meters, Q
|
||||
if ( !maskSource )
|
||||
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "OVERLAY" ) ) );
|
||||
|
||||
if ( featureSource->hasSpatialIndex() == QgsFeatureSource::SpatialIndexNotPresent )
|
||||
feedback->reportError( QObject::tr( "No spatial index exists for input layer, performance will be severely degraded" ) );
|
||||
|
||||
QString dest;
|
||||
QgsWkbTypes::GeometryType sinkType = QgsWkbTypes::geometryType( featureSource->wkbType() );
|
||||
std::unique_ptr< QgsFeatureSink > sink( parameterAsSink( parameters, QStringLiteral( "OUTPUT" ), context, dest, featureSource->fields(), QgsWkbTypes::multiType( featureSource->wkbType() ), featureSource->sourceCrs() ) );
|
||||
|
@ -70,6 +70,9 @@ QVariantMap QgsExtractByExtentAlgorithm::processAlgorithm( const QVariantMap &pa
|
||||
if ( !featureSource )
|
||||
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "INPUT" ) ) );
|
||||
|
||||
if ( featureSource->hasSpatialIndex() == QgsFeatureSource::SpatialIndexNotPresent )
|
||||
feedback->reportError( QObject::tr( "No spatial index exists for input layer, performance will be severely degraded" ) );
|
||||
|
||||
QgsRectangle extent = parameterAsExtent( parameters, QStringLiteral( "EXTENT" ), context, featureSource->sourceCrs() );
|
||||
bool clip = parameterAsBoolean( parameters, QStringLiteral( "CLIP" ), context );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user