Skip to content

Commit f4d3152

Browse files
committedNov 1, 2017
[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
1 parent eea155d commit f4d3152

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/providers/ogr/qgsogrfeatureiterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ bool QgsOgrFeatureIterator::fetchFeature( QgsFeature &feature )
266266
if ( !readFeature( std::move( fet ), feature ) )
267267
continue;
268268

269-
if ( !mFilterRect.isNull() && !feature.hasGeometry() )
269+
if ( !mFilterRect.isNull() && ( !feature.hasGeometry() || feature.geometry().isEmpty() ) )
270270
continue;
271271

272272
// we have a feature, end this cycle

0 commit comments

Comments
 (0)
Please sign in to comment.