mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-26 00:02:43 -04:00
[processing] Warn when we know for certain that no spatial index
exists on a source used for the Join by Location algorithm Advise users that performance will be severely degraded as a result.
This commit is contained in:
parent
37044b0a26
commit
2a5ee9b563
@ -38,7 +38,8 @@ from qgis.core import (QgsFields,
|
||||
QgsProcessingParameterField,
|
||||
QgsProcessingParameterFeatureSink,
|
||||
QgsProcessingParameterString,
|
||||
QgsProcessingOutputNumber)
|
||||
QgsProcessingOutputNumber,
|
||||
QgsFeatureSource)
|
||||
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
from processing.tools import vector
|
||||
@ -206,6 +207,9 @@ class SpatialJoin(QgisAlgorithm):
|
||||
features = join_source.getFeatures(request)
|
||||
total = 100.0 / join_source.featureCount() if join_source.featureCount() else 0
|
||||
|
||||
if source.hasSpatialIndex() == QgsFeatureSource.SpatialIndexNotPresent:
|
||||
feedback.reportError(self.tr('No spatial index exists for input layer, performance will be severely degraded'))
|
||||
|
||||
joined_count = 0
|
||||
unjoined_count = 0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user