File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,11 @@ QVariantMap QgsDeleteDuplicateGeometriesAlgorithm::processAlgorithm( const QVari
93
93
double step = mSource ->featureCount () > 0 ? 100.0 / mSource ->featureCount () : 0 ;
94
94
QHash< QgsFeatureId, QgsGeometry > geometries;
95
95
QSet< QgsFeatureId > nullGeometryFeatures;
96
- QgsSpatialIndex index;
97
- QgsFeature f;
98
96
long current = 0 ;
99
- while ( it. nextFeature ( f ) )
97
+ QgsSpatialIndex index ( it, [&]( const QgsFeature & f ) -> bool
100
98
{
101
99
if ( feedback->isCanceled () )
102
- break ;
100
+ return false ;
103
101
104
102
if ( !f.hasGeometry () )
105
103
{
@@ -108,13 +106,15 @@ QVariantMap QgsDeleteDuplicateGeometriesAlgorithm::processAlgorithm( const QVari
108
106
else
109
107
{
110
108
geometries.insert ( f.id (), f.geometry () );
111
- index.addFeature ( f );
112
109
}
113
110
114
111
// overall this loop takes about 10% of time
115
112
current++;
116
113
feedback->setProgress ( 0.10 * current * step );
117
- }
114
+ return true ;
115
+ } );
116
+
117
+ QgsFeature f;
118
118
119
119
// start by assuming everything is unique, and chop away at this list
120
120
QHash< QgsFeatureId, QgsGeometry > uniqueFeatures = geometries;
You can’t perform that action at this time.
0 commit comments