[QGIS Commit] r11801 - trunk/qgis/src/providers/ogr

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Oct 13 16:10:39 EDT 2009


Author: jef
Date: 2009-10-13 16:10:39 -0400 (Tue, 13 Oct 2009)
New Revision: 11801

Modified:
   trunk/qgis/src/providers/ogr/qgsogrprovider.cpp
Log:
ogr provider: fix feature count retrieval

Modified: trunk/qgis/src/providers/ogr/qgsogrprovider.cpp
===================================================================
--- trunk/qgis/src/providers/ogr/qgsogrprovider.cpp	2009-10-12 21:54:58 UTC (rev 11800)
+++ trunk/qgis/src/providers/ogr/qgsogrprovider.cpp	2009-10-13 20:10:39 UTC (rev 11801)
@@ -246,6 +246,12 @@
   }
   setDataSourceUri( uri );
 
+  OGR_L_ResetReading( ogrLayer );
+
+  // getting the total number of features in the layer
+  // TODO: This can be expensive, do we really need it!
+  featuresCounted = OGR_L_GetFeatureCount( ogrLayer, TRUE );
+
   // get the extent_ (envelope) of the layer
   QgsDebugMsg( "Starting get extent" );
 
@@ -254,10 +260,6 @@
 
   QgsDebugMsg( "Finished get extent" );
 
-  // getting the total number of features in the layer
-  // TODO: This can be expensive, do we really need it!
-  featuresCounted = OGR_L_GetFeatureCount( ogrLayer, TRUE );
-
   // check the validity of the layer
   QgsDebugMsg( "checking validity" );
   loadFields();



More information about the QGIS-commit mailing list