Skip to content

Commit 97eb0f7

Browse files
committed
[Geometry Checker] Don't add geometry-less features to feature-pool
1 parent adff069 commit 97eb0f7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/plugins/geometry_checker/utils/qgsfeaturepool.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,18 @@ QgsFeaturePool::QgsFeaturePool( QgsVectorLayer *layer, bool selectedOnly )
4444
QgsFeature feature;
4545
QgsFeatureRequest req;
4646
req.setSubsetOfAttributes( QgsAttributeList() );
47-
mIndex = QgsSpatialIndex( layer->getFeatures( req ) );
47+
QgsFeatureIterator it = layer->getFeatures( req );
48+
while ( it.nextFeature( feature ) )
49+
{
50+
if ( feature.geometry() )
51+
{
52+
mIndex.insertFeature( feature );
53+
}
54+
else
55+
{
56+
mFeatureIds.remove( feature.id() );
57+
}
58+
}
4859
}
4960

5061
bool QgsFeaturePool::get( QgsFeatureId id , QgsFeature& feature )

0 commit comments

Comments
 (0)