mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -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,
|
QgsFeatureSink,
|
||||||
QgsFeatureRequest,
|
QgsFeatureRequest,
|
||||||
QgsGeometry,
|
QgsGeometry,
|
||||||
|
QgsFeatureSource,
|
||||||
QgsCoordinateTransform,
|
QgsCoordinateTransform,
|
||||||
QgsStatisticalSummary,
|
QgsStatisticalSummary,
|
||||||
QgsDateTimeStatisticalSummary,
|
QgsDateTimeStatisticalSummary,
|
||||||
@ -160,6 +161,9 @@ class SpatialJoinSummary(QgisAlgorithm):
|
|||||||
if join_source is None:
|
if join_source is None:
|
||||||
raise QgsProcessingException(self.invalidSourceError(parameters, self.JOIN))
|
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)
|
join_fields = self.parameterAsFields(parameters, self.JOIN_FIELDS, context)
|
||||||
discard_nomatch = self.parameterAsBoolean(parameters, self.DISCARD_NONMATCHING, context)
|
discard_nomatch = self.parameterAsBoolean(parameters, self.DISCARD_NONMATCHING, context)
|
||||||
summaries = [self.statistics[i][0] for i in
|
summaries = [self.statistics[i][0] for i in
|
||||||
|
@ -96,6 +96,9 @@ QVariantMap QgsClipAlgorithm::processAlgorithm( const QVariantMap ¶meters, Q
|
|||||||
if ( !maskSource )
|
if ( !maskSource )
|
||||||
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "OVERLAY" ) ) );
|
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;
|
QString dest;
|
||||||
QgsWkbTypes::GeometryType sinkType = QgsWkbTypes::geometryType( featureSource->wkbType() );
|
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() ) );
|
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 )
|
if ( !featureSource )
|
||||||
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "INPUT" ) ) );
|
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() );
|
QgsRectangle extent = parameterAsExtent( parameters, QStringLiteral( "EXTENT" ), context, featureSource->sourceCrs() );
|
||||||
bool clip = parameterAsBoolean( parameters, QStringLiteral( "CLIP" ), context );
|
bool clip = parameterAsBoolean( parameters, QStringLiteral( "CLIP" ), context );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user