Skip to content
Permalink
Browse files

Try to detect WFS feature type if not available in describeFeatureTyp…

…e response. Fixes ticket #5745
  • Loading branch information
mhugent committed Jun 8, 2012
1 parent 2d722b1 commit 7b08cbaa319e38ca74cb5221289b68f5d1051d87
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/providers/wfs/qgswfsprovider.cpp
@@ -95,6 +95,18 @@ QgsWFSProvider::QgsWFSProvider( const QString& uri )
return;
}

//Failed to detect feature type from describeFeatureType -> get first feature from layer to detect type
if ( mWKBType == QGis::WKBUnknown )
{
QString bkUri = dataSourceUri();
QUrl typeDetectionUri( uri );
typeDetectionUri.removeQueryItem( "BBOX" );
typeDetectionUri.addQueryItem( "MAXFEATURES", "1" );
setDataSourceUri( typeDetectionUri.toString() );
reloadData();
setDataSourceUri( bkUri );
}

if ( ! uri.contains( "BBOX" ) )
{ //"Cache Features" option; get all features in layer immediately
reloadData();

0 comments on commit 7b08cba

Please sign in to comment.
You can’t perform that action at this time.