Skip to content
Permalink
Browse files
warn for WFS feature count limit
  • Loading branch information
tomtor authored and m-kuhn committed Dec 3, 2015
1 parent 320c696 commit e9eb233
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
@@ -63,6 +63,7 @@ QgsWFSProvider::QgsWFSProvider( const QString& uri )
, mWKBType( QGis::WKBUnknown )
, mSourceCRS( 0 )
, mFeatureCount( 0 )
, mMaxFeatureCount( 0 )
, mValid( true )
, mCached( false )
, mPendingRetrieval( false )
@@ -738,6 +739,15 @@ int QgsWFSProvider::getFeatureGET( const QString& uri, const QString& geometryAt
}
mFeatureCount = mFeatures.size();

if ( mFeatureCount && mFeatureCount >= mMaxFeatureCount && mFeatureCount % 500 == 0 )
QgsMessageLog::logMessage(
tr( "%1: %2 features fetched hints at reaching a download limit. " ).arg( typeName ).arg( mFeatureCount ) +
tr( "Zoom in to fetch all data if your layer has the 'current view extent' option enabled." ),
"WFS" );

if ( mFeatureCount > mMaxFeatureCount )
mMaxFeatureCount = mFeatureCount;

return 0;
}

@@ -203,6 +203,7 @@ class QgsWFSProvider : public QgsVectorDataProvider
/** Source CRS*/
QgsCoordinateReferenceSystem mSourceCRS;
int mFeatureCount;
int mMaxFeatureCount;
/** Flag if provider is valid*/
bool mValid;
bool mCached;

0 comments on commit e9eb233

Please sign in to comment.