Skip to content

Commit

Permalink
[ogr] Also discard features with empty geometries
Browse files Browse the repository at this point in the history
when feature request specifies a filter rect

OGR sometimes returns a feature with empty geometry (e.g.
a multipolygon with a polygon child with no rings) even when
OGR_L_SetSpatialFilterRect has been set for the layer.

Refs #17365
  • Loading branch information
nyalldawson committed Nov 1, 2017
1 parent eea155d commit f4d3152
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -266,7 +266,7 @@ bool QgsOgrFeatureIterator::fetchFeature( QgsFeature &feature )
if ( !readFeature( std::move( fet ), feature ) )
continue;

if ( !mFilterRect.isNull() && !feature.hasGeometry() )
if ( !mFilterRect.isNull() && ( !feature.hasGeometry() || feature.geometry().isEmpty() ) )
continue;

// we have a feature, end this cycle
Expand Down

0 comments on commit f4d3152

Please sign in to comment.