Skip to content

Commit

Permalink
ogr provider: fix feature count retrieval
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11801 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 13, 2009
1 parent 150c728 commit e3520c7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ bool QgsOgrProvider::setSubsetString( QString theSQL )
}
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" );

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

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();
Expand Down

0 comments on commit e3520c7

Please sign in to comment.