Skip to content

Commit

Permalink
[Geometry Checker] Don't add geometry-less features to feature-pool
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Dec 6, 2016
1 parent adff069 commit 97eb0f7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/plugins/geometry_checker/utils/qgsfeaturepool.cpp
Expand Up @@ -44,7 +44,18 @@ QgsFeaturePool::QgsFeaturePool( QgsVectorLayer *layer, bool selectedOnly )
QgsFeature feature;
QgsFeatureRequest req;
req.setSubsetOfAttributes( QgsAttributeList() );
mIndex = QgsSpatialIndex( layer->getFeatures( req ) );
QgsFeatureIterator it = layer->getFeatures( req );
while ( it.nextFeature( feature ) )
{
if ( feature.geometry() )
{
mIndex.insertFeature( feature );
}
else
{
mFeatureIds.remove( feature.id() );
}
}
}

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

0 comments on commit 97eb0f7

Please sign in to comment.