Skip to content

Commit e9eb233

Browse files
tomtorm-kuhn
authored andcommitted
warn for WFS feature count limit
1 parent 320c696 commit e9eb233

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/providers/wfs/qgswfsprovider.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ QgsWFSProvider::QgsWFSProvider( const QString& uri )
6363
, mWKBType( QGis::WKBUnknown )
6464
, mSourceCRS( 0 )
6565
, mFeatureCount( 0 )
66+
, mMaxFeatureCount( 0 )
6667
, mValid( true )
6768
, mCached( false )
6869
, mPendingRetrieval( false )
@@ -738,6 +739,15 @@ int QgsWFSProvider::getFeatureGET( const QString& uri, const QString& geometryAt
738739
}
739740
mFeatureCount = mFeatures.size();
740741

742+
if ( mFeatureCount && mFeatureCount >= mMaxFeatureCount && mFeatureCount % 500 == 0 )
743+
QgsMessageLog::logMessage(
744+
tr( "%1: %2 features fetched hints at reaching a download limit. " ).arg( typeName ).arg( mFeatureCount ) +
745+
tr( "Zoom in to fetch all data if your layer has the 'current view extent' option enabled." ),
746+
"WFS" );
747+
748+
if ( mFeatureCount > mMaxFeatureCount )
749+
mMaxFeatureCount = mFeatureCount;
750+
741751
return 0;
742752
}
743753

src/providers/wfs/qgswfsprovider.h

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ class QgsWFSProvider : public QgsVectorDataProvider
203203
/** Source CRS*/
204204
QgsCoordinateReferenceSystem mSourceCRS;
205205
int mFeatureCount;
206+
int mMaxFeatureCount;
206207
/** Flag if provider is valid*/
207208
bool mValid;
208209
bool mCached;

0 commit comments

Comments
 (0)