[ogr] Also discard features with empty geometries

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
This commit is contained in:
Nyall Dawson 2017-11-01 07:43:04 +10:00
parent eea155d6e2
commit f4d3152eea

View File

@ -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