Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
10 changes: 10 additions & 0 deletions src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -63,6 +63,7 @@ QgsWFSProvider::QgsWFSProvider( const QString& uri )
, mWKBType( QGis::WKBUnknown )
, mSourceCRS( 0 )
, mFeatureCount( 0 )
, mMaxFeatureCount( 0 )
, mValid( true )
, mCached( false )
, mPendingRetrieval( false )
Expand Down Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions src/providers/wfs/qgswfsprovider.h
Expand Up @@ -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;
Expand Down

0 comments on commit e9eb233

Please sign in to comment.