Skip to content

Commit 7a9c936

Browse files
author
jef
committed
ogr provider: fix feature count retrieval
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11801 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f680506 commit 7a9c936

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/providers/ogr/qgsogrprovider.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ bool QgsOgrProvider::setSubsetString( QString theSQL )
246246
}
247247
setDataSourceUri( uri );
248248

249+
OGR_L_ResetReading( ogrLayer );
250+
251+
// getting the total number of features in the layer
252+
// TODO: This can be expensive, do we really need it!
253+
featuresCounted = OGR_L_GetFeatureCount( ogrLayer, TRUE );
254+
249255
// get the extent_ (envelope) of the layer
250256
QgsDebugMsg( "Starting get extent" );
251257

@@ -254,10 +260,6 @@ bool QgsOgrProvider::setSubsetString( QString theSQL )
254260

255261
QgsDebugMsg( "Finished get extent" );
256262

257-
// getting the total number of features in the layer
258-
// TODO: This can be expensive, do we really need it!
259-
featuresCounted = OGR_L_GetFeatureCount( ogrLayer, TRUE );
260-
261263
// check the validity of the layer
262264
QgsDebugMsg( "checking validity" );
263265
loadFields();

0 commit comments

Comments
 (0)